Jest的完成建议构建器

时间:2014-03-14 14:35:32

标签: elasticsearch search-suggestion jest

jest中是否有内置解决方案用于向弹性搜索发送completion suggester个请求?

或者我需要为此实现自己的io.searchbox.AbstractAction吗?

1 个答案:

答案 0 :(得分:1)

Suggest suggest = new Suggest.Builder("{\n" +
                "  \"" + suggestionName + "\" : {\n" +
                "    \"text\" : \"the amsterdma meetpu\",\n" +
                "    \"term\" : {\n" +
                "      \"field\" : \"body\"\n" +
                "    }\n" +
                "  }\n" +
                "}").build();

SuggestResult result = client.execute(suggest);