Package com.attivio.util.query
Class QueryUtils
- java.lang.Object
-
- com.attivio.util.query.QueryUtils
-
public final class QueryUtils extends java.lang.ObjectUtility functions for working with queries.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QuerycreateIdQuery(java.lang.String id)Construct a query that will return only the document specified byid.static booleanisMatchAll(Query query)Get ifqueryis a *:* query.static QueryresolveQuery(QueryRequest request)Resolve the query fromrequest.static Queryrewrite(Query query, QueryHandler handler)Null Safe rewrite ofqueryusinghandler.static voidrewrite(java.util.List<Query> queries, QueryHandler handler)static voidrewriteAll(QueryRequest request, QueryHandler handler)Rewrite all queries inrequestusinghandlerstatic voidrewriteFacets(java.util.List<FacetRequest> facets, QueryHandler handler)Rewrite any embedded queries infacetsusinghandler.static voidrewriteFields(FieldExpression[] fields, QueryHandler handler)static QuerysetQueryLanguage(Query query, java.lang.String language)Set the query language forquerytolanguage.static QuerysetQueryString(Query query, java.lang.String value)Set the query string forquerytovalue.
-
-
-
Method Detail
-
resolveQuery
public static Query resolveQuery(QueryRequest request)
Resolve the query fromrequest.This method applies all filters and boosts on
requestto the returned query.
-
isMatchAll
public static boolean isMatchAll(Query query)
Get ifqueryis a *:* query.
-
createIdQuery
public static Query createIdQuery(java.lang.String id)
Construct a query that will return only the document specified byid.
-
setQueryString
public static Query setQueryString(Query query, java.lang.String value)
Set the query string forquerytovalue.
-
setQueryLanguage
public static Query setQueryLanguage(Query query, java.lang.String language)
Set the query language forquerytolanguage.
-
rewriteAll
public static void rewriteAll(QueryRequest request, QueryHandler handler)
Rewrite all queries inrequestusinghandlerWARNING: do not use this method unless you are sure you want to modify absolutely all queries in
request.This method rewrites all queries in:
QueryRequest.getQuery(),QueryRequest.getBoostQueries(),QueryRequest.getFilters(),QueryRequest.getFields(),QueryRequest.getFacets().
-
rewrite
public static Query rewrite(Query query, QueryHandler handler)
Null Safe rewrite ofqueryusinghandler.
-
rewrite
public static void rewrite(java.util.List<Query> queries, QueryHandler handler)
-
rewriteFields
public static void rewriteFields(FieldExpression[] fields, QueryHandler handler)
-
rewriteFacets
public static void rewriteFacets(java.util.List<FacetRequest> facets, QueryHandler handler)
Rewrite any embedded queries infacetsusinghandler.
-
-