public class QueryBuilder
extends java.lang.Object
Constructor and Description |
---|
QueryBuilder() |
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.search.Query |
build()
Build a new query based on the query text that has been passed in to this
builder.
|
java.lang.String |
getDefs()
Get search string for the "full" field.
|
java.lang.String |
getFreetext()
Get search string for the "full" field.
|
java.lang.String |
getHist()
Get search string for the "hist" field.
|
java.lang.String |
getPath()
Get search string for the "path" field.
|
java.util.Map<java.lang.String,java.lang.String> |
getQueries()
Get a map containing the query text for each of the fields that have
been set.
|
java.lang.String |
getRefs()
Get search string for the "refs" field.
|
int |
getSize()
Get the number of query fields set.
|
QueryBuilder |
setDefs(java.lang.String defs)
Set search string for the "defs" field.
|
QueryBuilder |
setFreetext(java.lang.String freetext)
Set search string for the "full" field.
|
QueryBuilder |
setHist(java.lang.String hist)
Set search string for the "hist" field.
|
QueryBuilder |
setPath(java.lang.String path)
Set search string for the "path" field.
|
QueryBuilder |
setRefs(java.lang.String refs)
Set search string for the "refs" field.
|
public QueryBuilder setFreetext(java.lang.String freetext)
freetext
- query string to setpublic java.lang.String getFreetext()
null
if not set, the query string otherwise.public QueryBuilder setDefs(java.lang.String defs)
defs
- query string to setpublic java.lang.String getDefs()
null
if not set, the query string otherwise.public QueryBuilder setRefs(java.lang.String refs)
refs
- query string to setpublic java.lang.String getRefs()
null
if not set, the query string otherwise.public QueryBuilder setPath(java.lang.String path)
path
- query string to setpublic java.lang.String getPath()
null
if not set, the query string otherwise.public QueryBuilder setHist(java.lang.String hist)
hist
- query string to setpublic java.lang.String getHist()
null
if not set, the query string otherwise.public java.util.Map<java.lang.String,java.lang.String> getQueries()
public int getSize()
public org.apache.lucene.search.Query build() throws org.apache.lucene.queryParser.ParseException
null
if no query text is available.org.apache.lucene.queryParser.ParseException
- if the query text cannot be parsed