MCPcopy Index your code
hub / github.com/apache/answer-plugins / TestSearchEngine_QueryDoc

Function TestSearchEngine_QueryDoc

search-elasticsearch/es_test.go:76–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestSearchEngine_QueryDoc(t *testing.T) {
77 operator, err := NewOperator(testEndpoints, testUsername, testPassword)
78 if err != nil {
79 t.Fatal(err)
80 }
81 doc, err := operator.QueryDoc(context.Background(), testIndex, elastic.NewMatchAllQuery(), nil, nil, 0, 5)
82 if err != nil {
83 t.Fatal(err)
84 }
85 for i, hit := range doc.Hits.Hits {
86 data, _ := hit.Source.MarshalJSON()
87 t.Logf("%d: %+v", i, string(data))
88 }
89}

Callers

nothing calls this directly

Calls 2

QueryDocMethod · 0.95
NewOperatorFunction · 0.85

Tested by

no test coverage detected