use of io.searchbox.params.SearchType in project xwiki-platform by xwiki.
the class DefaultDataManager method searchInstalls.
@Override
public JsonObject searchInstalls(String indexType, String fullQuery, Map<String, Object> parameters) throws Exception {
Search.Builder searchBuilder = new Search.Builder(fullQuery).addIndex(JestClientManager.INDEX).addType(indexType);
// Add parameters and handle specifically the Search Type.
if (parameters.containsKey(Parameters.SEARCH_TYPE)) {
SearchType searchType = this.converterManager.convert(SearchType.class, parameters.get(Parameters.SEARCH_TYPE));
searchBuilder.setSearchType(searchType);
}
for (Map.Entry<String, Object> parameterEntry : parameters.entrySet()) {
if (!parameterEntry.getKey().equals(Parameters.SEARCH_TYPE)) {
searchBuilder.setParameter(parameterEntry.getKey(), parameterEntry.getValue());
}
}
return executeActionQuery(searchBuilder.build(), fullQuery).getJsonObject();
}
Aggregations