return normalized;
}
public Query toQuery(Object... terms) {
List<String> queryTerms = normalizeTerms(terms);
Query query = Query.from(Object.class);
for (Rule rule : getRules()) {
rule.apply(this, query, queryTerms);
}
if (!queryTerms.isEmpty()) {
query.and("_any matchesAny ?", queryTerms);
query.sortRelevant(100000.0, "_any matchesAll ?", terms);
}
Set<ObjectType> allTypes = new HashSet<ObjectType>();
for (ObjectType type : getTypes()) {
allTypes.addAll(type.as(ToolUi.class).findDisplayTypes());
}
query.and("_type = ?", allTypes);
return query;
}