Package org.nuxeo.elasticsearch.query
Class NxqlQueryConverter
java.lang.Object
org.nuxeo.elasticsearch.query.NxqlQueryConverter
Helper class that holds the conversion logic. Conversion is based on the existing NXQL Parser, we are just using a
visitor to build the ES request.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Class to hold both a query and a filter -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static SQLQuery
addSecurityPolicy
(CoreSession session, SQLQuery query) protected static Object
checkBoolValue
(String nxqlName, Object value) protected static String
protected static String
getFieldName
(String name, EsHint hint) protected static org.opensearch.index.query.MoreLikeThisQueryBuilder.Item[]
Deprecated.since 11.1.getSelectClauseFields
(String nxql) getSortInfo
(String nxql) protected static SQLQuery
getSqlQuery
(String nxql) protected static String
likeToWildcard
(String like) Turns a NXQL LIKE pattern into a wildcard for WildcardQuery.protected static org.opensearch.index.query.QueryBuilder
makeAncestorIdFilter
(String value, CoreSession session) protected static org.opensearch.index.query.QueryBuilder
makeFulltextQuery
(String nxqlName, String value, EsHint hint) protected static org.opensearch.index.query.QueryBuilder
makeHintQuery
(String name, Object value, EsHint hint) protected static org.opensearch.index.query.QueryBuilder
makeLikeQuery
(String op, String name, String value, EsHint hint) makeQueryFromSimpleExpression
(String op, String nxqlName, Object value, Object[] values, EsHint hint, CoreSession session) static org.opensearch.index.query.QueryBuilder
makeStartsWithQuery
(String name, Object value) protected static org.opensearch.index.query.QueryBuilder
makeTrashedFilter
(String op, String name, String value) static org.opensearch.index.query.QueryBuilder
toESQueryBuilder
(String nxql) static org.opensearch.index.query.QueryBuilder
toESQueryBuilder
(String nxql, CoreSession session) static String
translateFulltextQuery
(String query) Translates from Nuxeo syntax to Elasticsearch simple_query_string syntax.
-
Field Details
-
SELECT_ALL
- See Also:
-
SELECT_ALL_WHERE
- See Also:
-
SIMPLE_QUERY_PREFIX
- See Also:
-
MORE_LIKE_THIS_MIN_TERM_FREQ
Deprecated.since 11.1. UseMoreLikeThisESHintQueryBuilder.MORE_LIKE_THIS_MIN_TERM_FREQ
instead.- See Also:
-
MORE_LIKE_THIS_MIN_DOC_FREQ
Deprecated.since 11.1. UseMoreLikeThisESHintQueryBuilder.MORE_LIKE_THIS_MIN_DOC_FREQ
instead.- See Also:
-
MORE_LIKE_THIS_MAX_QUERY_TERMS
Deprecated.since 11.1. UseMoreLikeThisESHintQueryBuilder.MORE_LIKE_THIS_MAX_QUERY_TERMS
instead.- See Also:
-
-
Method Details
-
toESQueryBuilder
-
toESQueryBuilder
public static org.opensearch.index.query.QueryBuilder toESQueryBuilder(String nxql, CoreSession session) -
getSqlQuery
-
addSecurityPolicy
-
completeQueryWithSelect
-
makeQueryFromSimpleExpression
public static NxqlQueryConverter.QueryAndFilter makeQueryFromSimpleExpression(String op, String nxqlName, Object value, Object[] values, EsHint hint, CoreSession session) -
checkBoolValue
-
makeTrashedFilter
-
makeHintQuery
-
getItems
@Deprecated protected static org.opensearch.index.query.MoreLikeThisQueryBuilder.Item[] getItems(Object value) Deprecated.since 11.1. UseMoreLikeThisESHintQueryBuilder.getItems(Object)
instead. -
makeStartsWithQuery
-
makeAncestorIdFilter
protected static org.opensearch.index.query.QueryBuilder makeAncestorIdFilter(String value, CoreSession session) -
makeLikeQuery
-
likeToWildcard
Turns a NXQL LIKE pattern into a wildcard for WildcardQuery.% and _ are standard wildcards, and \ escapes them.
- Since:
- 7.4
-
makeFulltextQuery
-
getFieldName
-
getSortInfo
-
getSelectClauseFields
-
translateFulltextQuery
Translates from Nuxeo syntax to Elasticsearch simple_query_string syntax.
-