Package org.elasticsearch.search.suggest.completion

Examples of org.elasticsearch.search.suggest.completion.CompletionSuggestion


    .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


    .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

            switch (type) {
            case TermSuggestion.TYPE:
                suggestion = new TermSuggestion();
                break;
            case CompletionSuggestion.TYPE:
                suggestion = new CompletionSuggestion();
                break;
            case PhraseSuggestion.TYPE:
                suggestion = new PhraseSuggestion();
                break;
            default:
View Full Code Here

TOP

Related Classes of org.elasticsearch.search.suggest.completion.CompletionSuggestion

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.