public final class Query extends Object
Query
instance persists and interprets the arguments passed in through the Searcher
API. It does not override Object.hashCode()
and Object.equals(Object)
and hence cannot be used in sets. The Searcher
interface can be used to build an instance of the Query
class.Modifier and Type | Field and Description |
---|---|
static BigInteger |
DEFAULT_VALUE_START_AT
Default page start index: 1
|
static BigInteger |
DEFAULT_VALUE_TOP
Default page size: 1000
|
Constructor and Description |
---|
Query()
Default constructor.
|
Query(Query source)
Copy constructor builds a new instance from the source.
|
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getFields()
Returns the fields set into this query.
|
Filter |
getFilter()
Returns the filter condition set into this query.
|
Map<String,Collection<String>> |
getFrom()
Returns the types set into this query.
|
String |
getIn()
Returns the site name set into this query.
|
Orders |
getOrders()
Returns the order sequence set into this query.
|
String |
getPhrase()
Returns the phrase set into this query.
|
BigInteger |
getStart()
Returns the page start index set into this query.
|
BigInteger |
getTop()
Returns the page size set into this query.
|
boolean |
isAllFields()
Returns
true if all fields in the results are to be returned. |
void |
setAllFields(boolean allFields)
Set to
true if all fields are to be returned. |
void |
setFields(Collection<String> fields)
Sets the fields into this query.
|
void |
setFilter(Filter filter)
Sets the filter condition into this query.
|
void |
setFrom(Map<String,Collection<String>> from)
Sets the types into this query.
|
void |
setIn(String in)
Sets the site name into this query.
|
void |
setOrders(Orders orders)
Sets the order sequence into this query.
|
void |
setPhrase(String phrase)
Sets the phrase into this query.
|
void |
setStart(BigInteger start)
Sets the page start index into this query.
|
void |
setTop(BigInteger top)
Sets the page size into this query.
|
String |
toString()
Returns a string representation of this query.
|
public static final BigInteger DEFAULT_VALUE_TOP
public static final BigInteger DEFAULT_VALUE_START_AT
public Query()
Query.DEFAULT_VALUE_TOP
and start index to Query.DEFAULT_VALUE_START_AT
.public Query(Query source)
source
- the source instance from which the state is replicated in the new instance.public String getPhrase()
public void setPhrase(String phrase)
phrase
- the phrase to setpublic Collection<String> getFields()
public void setFields(Collection<String> fields)
fields
- the fields to setpublic boolean isAllFields()
true
if all fields in the results are to be returned.true
if all fields are to be returned.public void setAllFields(boolean allFields)
true
if all fields are to be returned.allFields
- true
if all fields the fields are to be returned.public Map<String,Collection<String>> getFrom()
public void setFrom(Map<String,Collection<String>> from)
from
- the types to query against.public String getIn()
public void setIn(String in)
in
- the site name to setpublic Filter getFilter()
public void setFilter(Filter filter)
filter
- the filter condition to setpublic Orders getOrders()
public void setOrders(Orders orders)
orders
- the order sequence to setpublic BigInteger getTop()
public void setTop(BigInteger top)
Query.DEFAULT_VALUE_TOP
.top
- the size of the results page to fetchpublic BigInteger getStart()
public void setStart(BigInteger start)
Query.DEFAULT_VALUE_START_AT
.start
- the start index of the results page to fetchpublic String toString()
SELECT
TOP
[top
] START FROM
[start
] fields or ALL
FROM
from
WHERE
filter
ORDER BY
first order
THEN BY
more orders...
. For phrase search, the string representation is like: SEARCH FOR
[phrase
] ...
toString
in class Object
Object.toString()