public class QueryBuilder extends Object
More information about the JSON query syntax can be found in
JsonQueryParser
.
The builder enables the creation of AbstractQuery
which can then be
converted into a JSON representation using the method
AbstractQuery.toString()
or into a Query
using the method
AbstractQuery.toQuery(boolean)
.
JsonQueryParser
Constructor and Description |
---|
QueryBuilder() |
QueryBuilder(JsonQueryConfigHandler config) |
Modifier and Type | Method and Description |
---|---|
BooleanQuery |
newBoolean()
Create a new boolean query
|
NodeQuery |
newNode(String booleanExpression)
Create a new node query with the specified boolean expression
|
TwigQuery |
newTwig()
Create a new twig query with empty root
|
TwigQuery |
newTwig(String booleanExpression)
Create a new twig query with the specified boolean expression as root query
|
public QueryBuilder()
public QueryBuilder(JsonQueryConfigHandler config)
public NodeQuery newNode(String booleanExpression) throws org.apache.lucene.queryparser.flexible.core.QueryNodeException
The boolean expression must follow the syntax of the
KeywordQueryParser
.
org.apache.lucene.queryparser.flexible.core.QueryNodeException
public BooleanQuery newBoolean()
public TwigQuery newTwig()
public TwigQuery newTwig(String booleanExpression) throws org.apache.lucene.queryparser.flexible.core.QueryNodeException
The boolean expression must follow the syntax of the
KeywordQueryParser
.
org.apache.lucene.queryparser.flexible.core.QueryNodeException
Copyright © 2014. All rights reserved.