Skip to content

Commit

Permalink
test was missing tie-break for the two suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemccand committed Apr 24, 2014
1 parent fcf9456 commit cade646
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,16 @@ public void testThatSuggestStopFilterWorks() throws Exception {
createIndexAndMappingAndSettings(settingsBuilder.build(), completionMappingBuilder);

client().prepareIndex(INDEX, TYPE, "1").setSource(jsonBuilder()
.startObject().field(FIELD, "Feed trolls").endObject()
.startObject().startObject(FIELD)
.startArray("input").value("Feed trolls").endArray()
.field("weight", 5).endObject().endObject()
).get();

client().prepareIndex(INDEX, TYPE, "2").setSource(jsonBuilder()
.startObject().field(FIELD, "Feed the trolls").endObject()
// Higher weight so it's ranked first:
client().prepareIndex(INDEX, TYPE, "1").setSource(jsonBuilder()
.startObject().startObject(FIELD)
.startArray("input").value("Feed the trolls").endArray()
.field("weight", 10).endObject().endObject()
).get();

refresh();
Expand Down

0 comments on commit cade646

Please sign in to comment.