use of org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse.AnalyzeToken in project graylog2-server by Graylog2.
the class Messages method analyze.
public List<String> analyze(String string, String index, String analyzer) {
final AnalyzeResponse response = c.admin().indices().prepareAnalyze(index, string).setAnalyzer(analyzer).get();
final List<AnalyzeToken> tokens = response.getTokens();
final List<String> terms = new ArrayList<>(tokens.size());
for (AnalyzeToken token : tokens) {
terms.add(token.getTerm());
}
return terms;
}
Aggregations