public abstract class BaseSearchQuery extends Object implements ISearchQuery, Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
protected Integer |
fInvocationID |
protected String |
fKeywordsField |
protected String[] |
fKeywordTerms |
protected Integer |
fMaxResults |
protected String[] |
fNormalizedKeywordTerms |
protected Map<String,Object> |
fRefineFields |
protected Boolean |
fUseOrCondition |
Constructor and Description |
---|
BaseSearchQuery() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset the query state back to the original values
|
protected Object |
clone() |
ISearchQuery |
cloneSearchQuery()
Makes a clone of this search query
|
boolean |
equals(Object obj) |
Integer |
getInvocationID()
Gets the search invocation.
|
String |
getKeywordsField()
Gets the raw value of the keywords field
|
String[] |
getKeywordTerms()
Gets the keywords parsed into terms
|
Integer |
getMaxResults()
Gets the maximum number of results allowed
|
String[] |
getNormalizedKeywordTerms()
Gets the keywords parsed into normalized terms
|
static String[] |
getNormalizedSearchTerms(String query)
Parses query into single normalized terms.
|
Map<String,Object> |
getRefineFields()
Return the map of refine fields
|
Boolean |
getUseOrCondition()
Returns true if the refine fields should be treated as 'OR'
terms, or false if the fields should be treated as 'AND' terms.
|
int |
hashCode() |
Boolean |
isUseOrCondition()
Returns true if the refine fields should be treated as 'OR'
terms, or false if the fields should be treated as 'AND' terms.
|
protected String |
makeContainsTerm(String temp)
Wrapps the value with wildcard characters
|
protected static String[] |
parseSearchTerms(String s)
Splits the given query string to search terms.
|
protected static String[] |
parseSearchTerms(String s,
boolean normalize)
Splits the given query string to search terms.
|
abstract void |
populateFromSearchStateString(String stateString)
Import the search state from a state string
|
void |
setInvocationID(Integer invokeID)
Sets the search invocation id
|
void |
setKeywordsField(String keywordsField)
Sets the raw value of the keywords field
|
void |
setMaxResults(Integer maxResults)
Sets the max number of results allowed.
|
void |
setRefineFields(Map<String,Object> refineFields)
Sets the refine field map
|
void |
setUseOrCondition(Boolean useOrCondition)
Sets whether the refine fields should be treated as 'OR'
terms or 'AND' terms.
|
abstract String |
toSearchStateString(ISearchStateOptions options)
Export the search state to a string
|
protected Integer fInvocationID
protected Integer fMaxResults
protected String fKeywordsField
protected Boolean fUseOrCondition
protected transient String[] fKeywordTerms
protected transient String[] fNormalizedKeywordTerms
public static String[] getNormalizedSearchTerms(String query)
public void clear()
clear
in interface ISearchQuery
public Integer getInvocationID()
getInvocationID
in interface ISearchQuery
public void setInvocationID(Integer invokeID)
setInvocationID
in interface ISearchQuery
invokeID
- the id of the search invocationprotected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Integer getMaxResults()
getMaxResults
in interface ISearchQuery
public void setMaxResults(Integer maxResults)
maxResults
- The maxResults to set.public Boolean getUseOrCondition()
getUseOrCondition
in interface ISearchQuery
public Boolean isUseOrCondition()
public void setUseOrCondition(Boolean useOrCondition)
useOrCondition
- true of 'OR' terms, false for 'AND' termspublic String getKeywordsField()
getKeywordsField
in interface ISearchQuery
public void setKeywordsField(String keywordsField)
keywordsField
- The keywordsField to set.public String[] getKeywordTerms()
getKeywordTerms
in interface ISearchQuery
public String[] getNormalizedKeywordTerms()
getNormalizedKeywordTerms
in interface ISearchQuery
public Map<String,Object> getRefineFields()
getRefineFields
in interface ISearchQuery
public void setRefineFields(Map<String,Object> refineFields)
refineFields
- The refineFields to set.public abstract void populateFromSearchStateString(String stateString)
populateFromSearchStateString
in interface ISearchQuery
stateString
- the search state string (from toSearchStateString method)public abstract String toSearchStateString(ISearchStateOptions options)
toSearchStateString
in interface ISearchQuery
options
- the options to use when writing the search statepublic ISearchQuery cloneSearchQuery()
cloneSearchQuery
in interface ISearchQuery
protected static String[] parseSearchTerms(String s)
s
- the search query stringprotected static String[] parseSearchTerms(String s, boolean normalize)
s
- the search query stringnormalize
- true to normalize the string before parsing, false otherwiseprotected String makeContainsTerm(String temp)
temp
- the value to wrap