From 961c04cae992eadb42d286d2f85f8a675bdc68c8 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 29 Jan 2018 14:17:40 -0800 Subject: Upgrading server dependancies (#8154) --- vendor/gopkg.in/olivere/elastic.v5/highlight_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'vendor/gopkg.in/olivere/elastic.v5/highlight_test.go') diff --git a/vendor/gopkg.in/olivere/elastic.v5/highlight_test.go b/vendor/gopkg.in/olivere/elastic.v5/highlight_test.go index 9687cfb79..c7b972c44 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/highlight_test.go +++ b/vendor/gopkg.in/olivere/elastic.v5/highlight_test.go @@ -117,8 +117,10 @@ func TestHighlighterWithExplicitFieldOrder(t *testing.T) { } } -func TestHighlightWithBoundaryChars(t *testing.T) { - builder := NewHighlight().BoundaryChars(" \t\r") +func TestHighlightWithBoundarySettings(t *testing.T) { + builder := NewHighlight(). + BoundaryChars(" \t\r"). + BoundaryScannerType("word") src, err := builder.Source() if err != nil { t.Fatal(err) @@ -128,7 +130,7 @@ func TestHighlightWithBoundaryChars(t *testing.T) { t.Fatalf("marshaling to JSON failed: %v", err) } got := string(data) - expected := `{"boundary_chars":" \t\r"}` + expected := `{"boundary_chars":" \t\r","boundary_scanner":"word"}` if got != expected { t.Errorf("expected\n%s\n,got:\n%s", expected, got) } @@ -142,17 +144,17 @@ func TestHighlightWithTermQuery(t *testing.T) { tweet3 := tweet{User: "sandrae", Message: "Cycling is fun to do."} // Add all documents - _, err := client.Index().Index(testIndexName).Type("tweet").Id("1").BodyJson(&tweet1).Do(context.TODO()) + _, err := client.Index().Index(testIndexName).Type("doc").Id("1").BodyJson(&tweet1).Do(context.TODO()) if err != nil { t.Fatal(err) } - _, err = client.Index().Index(testIndexName).Type("tweet").Id("2").BodyJson(&tweet2).Do(context.TODO()) + _, err = client.Index().Index(testIndexName).Type("doc").Id("2").BodyJson(&tweet2).Do(context.TODO()) if err != nil { t.Fatal(err) } - _, err = client.Index().Index(testIndexName).Type("tweet").Id("3").BodyJson(&tweet3).Do(context.TODO()) + _, err = client.Index().Index(testIndexName).Type("doc").Id("3").BodyJson(&tweet3).Do(context.TODO()) if err != nil { t.Fatal(err) } -- cgit v1.2.3-1-g7c22