Package org.elasticsearch.action.suggest

Examples of org.elasticsearch.action.suggest.SuggestResponse


  CompletionSuggestionFuzzyBuilder completionSuggestionFuzzyBuilder = new CompletionSuggestionFuzzyBuilder("test-suggest")
    .text("m")
    .field("suggest");

  //when
  SuggestResponse suggestResponse = elasticsearchTemplate.suggest(completionSuggestionFuzzyBuilder, CompletionEntity.class);
  CompletionSuggestion completionSuggestion = suggestResponse.getSuggest().getSuggestion("test-suggest");
  List<CompletionSuggestion.Entry.Option> options = completionSuggestion.getEntries().get(0).getOptions();

  //then
  assertThat(options.size(), is(2));
    assertThat(options.get(0).getText().string(), isOneOf("Marchand","Mohsin Husen"));
View Full Code Here


  CompletionSuggestionFuzzyBuilder completionSuggestionFuzzyBuilder = new CompletionSuggestionFuzzyBuilder("test-suggest")
    .text("m")
    .field("suggest");

  //when
  SuggestResponse suggestResponse = elasticsearchTemplate.suggest(completionSuggestionFuzzyBuilder, CompletionEntity.class);
  CompletionSuggestion completionSuggestion = suggestResponse.getSuggest().getSuggestion("test-suggest");
  List<CompletionSuggestion.Entry.Option> options = completionSuggestion.getEntries().get(0).getOptions();

  //then
  assertThat(options.size(), is(2));
  assertThat(options.get(0).getText().string(), isOneOf("Marchand","Mohsin Husen"));
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.suggest.SuggestResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.