(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestQueryStringQueryIntegration(t *testing.T) { |
| 50 | client := setupTestClientAndCreateIndexAndAddDocs(t) //, SetTraceLog(log.New(os.Stdout, "", log.LstdFlags))) |
| 51 | |
| 52 | q := NewQueryStringQuery("Golang") |
| 53 | |
| 54 | // Match all should return all documents |
| 55 | searchResult, err := client.Search(). |
| 56 | Index(testIndexName). |
| 57 | Query(q). |
| 58 | Pretty(true). |
| 59 | Do(context.TODO()) |
| 60 | if err != nil { |
| 61 | t.Fatal(err) |
| 62 | } |
| 63 | if searchResult.Hits == nil { |
| 64 | t.Errorf("expected SearchResult.Hits != nil; got nil") |
| 65 | } |
| 66 | if got, want := searchResult.TotalHits(), int64(1); got != want { |
| 67 | t.Errorf("expected SearchResult.TotalHits() = %d; got %d", want, got) |
| 68 | } |
| 69 | if got, want := len(searchResult.Hits.Hits), 1; got != want { |
| 70 | t.Errorf("expected len(SearchResult.Hits.Hits) = %d; got %d", want, got) |
| 71 | } |
| 72 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…