public final class QueryUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Query |
createIdQuery(String id)
Construct a query that will return only the document specified by
id . |
static boolean |
isMatchAll(Query query)
Get if
query is a *:* query. |
static Query |
resolveQuery(QueryRequest request)
Resolve the query from
request . |
static void |
rewrite(List<Query> queries,
QueryHandler handler) |
static Query |
rewrite(Query query,
QueryHandler handler)
Null Safe rewrite of
query using handler . |
static void |
rewriteAll(QueryRequest request,
QueryHandler handler)
Rewrite all queries in
request using handler |
static void |
rewriteFacets(List<FacetRequest> facets,
QueryHandler handler)
Rewrite any embedded queries in
facets using handler . |
static void |
rewriteFields(FieldExpression[] fields,
QueryHandler handler) |
static Query |
setQueryLanguage(Query query,
String language)
Set the query language for
query to language . |
static Query |
setQueryString(Query query,
String value)
Set the query string for
query to value . |
public static Query resolveQuery(QueryRequest request)
request
.
This method applies all filters and boosts on request
to the returned query.
public static boolean isMatchAll(Query query)
query
is a *:* query.public static Query createIdQuery(String id)
id
.public static Query setQueryString(Query query, String value)
query
to value
.public static Query setQueryLanguage(Query query, String language)
query
to language
.public static void rewriteAll(QueryRequest request, QueryHandler handler)
request
using handler
WARNING: 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()
.
public static Query rewrite(Query query, QueryHandler handler)
query
using handler
.public static void rewrite(List<Query> queries, QueryHandler handler)
public static void rewriteFields(FieldExpression[] fields, QueryHandler handler)
public static void rewriteFacets(List<FacetRequest> facets, QueryHandler handler)
facets
using handler
.Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.