public final class ElasticsearchQueryModel
extends java.lang.Object
Elasticsearch query model.
Constructor and Description |
---|
ElasticsearchQueryModel() |
Modifier and Type | Method and Description |
---|---|
void |
addConjunctiveFilter(java.lang.String name,
Node value,
Operator op) |
void |
addDisjunctiveFilter(java.lang.String name,
Node value,
Operator op) |
void |
addFacet(java.lang.String key,
java.lang.String value) |
TokenType |
getElasticsearchType(java.lang.String key)
Determine if the key has a type.
|
Expression |
getFacetExpression() |
Expression |
getFilterExpression()
Get filter expression.
|
Expression |
getSort()
Get sort expression.
|
boolean |
getVisibility(java.lang.String context)
Get expression visibility of a given context.
|
boolean |
hasFacets() |
boolean |
hasFilter() |
boolean |
isFacetContext(java.lang.String context)
Check if this context is the facet context.
|
boolean |
isFilterContext(java.lang.String context)
Check if this context is the filter context.
|
void |
setSort(java.util.Stack<Node> indexAndModifier)
Add sort expression.
|
public TokenType getElasticsearchType(java.lang.String key)
Determine if the key has a type. Default type is string.
key
- the key to checkpublic boolean getVisibility(java.lang.String context)
Get expression visibility of a given context.
context
- the contextpublic boolean isFacetContext(java.lang.String context)
Check if this context is the facet context.
context
- the contextpublic boolean isFilterContext(java.lang.String context)
Check if this context is the filter context.
context
- the contextpublic boolean hasFacets()
public void addFacet(java.lang.String key, java.lang.String value)
public Expression getFacetExpression()
public void addConjunctiveFilter(java.lang.String name, Node value, Operator op)
public void addDisjunctiveFilter(java.lang.String name, Node value, Operator op)
public boolean hasFilter()
public Expression getFilterExpression()
Get filter expression. Only one filter expression is allowed per query. First, build conjunctive and disjunctive filter terms. If both are null, there is no filter at all. Otherwise, combine conjunctive and disjunctive filter terms with a disjunction, and apply filter function, and return this expression.
public void setSort(java.util.Stack<Node> indexAndModifier)
Add sort expression.
indexAndModifier
- the index with modifierspublic Expression getSort()
Get sort expression.