Class BaseSearchQuery
java.lang.Object
com.webmethods.caf.faces.search.query.BaseSearchQuery
- All Implemented Interfaces:
ISearchQuery
,Serializable
,Cloneable
- Direct Known Subclasses:
WmCommonSearch65xSearchQuery
public abstract class BaseSearchQuery
extends Object
implements ISearchQuery, Cloneable, Serializable
Abstract base class for SearchQuery implementations.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the query state back to the original valuesprotected Object
clone()
Makes a clone of this search queryboolean
Gets the search invocation.Gets the raw value of the keywords fieldString[]
Gets the keywords parsed into termsGets the maximum number of results allowedString[]
Gets the keywords parsed into normalized termsstatic String[]
getNormalizedSearchTerms
(String query) Parses query into single normalized terms.Return the map of refine fieldsReturns true if the refine fields should be treated as 'OR' terms, or false if the fields should be treated as 'AND' terms.int
hashCode()
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 charactersprotected static String[]
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 stringvoid
setInvocationID
(Integer invokeID) Sets the search invocation idvoid
setKeywordsField
(String keywordsField) Sets the raw value of the keywords fieldvoid
setMaxResults
(Integer maxResults) Sets the max number of results allowed.void
setRefineFields
(Map<String, Object> refineFields) Sets the refine field mapvoid
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
-
Field Details
-
fInvocationID
-
fMaxResults
-
fKeywordsField
-
fRefineFields
-
fUseOrCondition
-
fKeywordTerms
-
fNormalizedKeywordTerms
-
-
Constructor Details
-
BaseSearchQuery
public BaseSearchQuery()
-
-
Method Details
-
getNormalizedSearchTerms
Parses query into single normalized terms.- Returns:
- the normalized keyword terms for the query
-
clear
public void clear()Reset the query state back to the original values- Specified by:
clear
in interfaceISearchQuery
-
getInvocationID
Gets the search invocation. This value changes every time the user does a new search action. If the value is zero, then no search has been executed yet.- Specified by:
getInvocationID
in interfaceISearchQuery
- Returns:
- the id of the search invocation or zero if no search has been executed yet.
-
setInvocationID
Sets the search invocation id- Specified by:
setInvocationID
in interfaceISearchQuery
- Parameters:
invokeID
- the id of the search invocation
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getMaxResults
Gets the maximum number of results allowed- Specified by:
getMaxResults
in interfaceISearchQuery
- Returns:
- max results number
-
setMaxResults
Sets the max number of results allowed.- Parameters:
maxResults
- The maxResults to set.
-
getUseOrCondition
Returns true if the refine fields should be treated as 'OR' terms, or false if the fields should be treated as 'AND' terms.- Specified by:
getUseOrCondition
in interfaceISearchQuery
- Returns:
- true or false
-
isUseOrCondition
Returns true if the refine fields should be treated as 'OR' terms, or false if the fields should be treated as 'AND' terms.- Returns:
- true or false
-
setUseOrCondition
Sets whether the refine fields should be treated as 'OR' terms or 'AND' terms.- Parameters:
useOrCondition
- true of 'OR' terms, false for 'AND' terms
-
getKeywordsField
Gets the raw value of the keywords field- Specified by:
getKeywordsField
in interfaceISearchQuery
- Returns:
- the raw value of the keywords field
-
setKeywordsField
Sets the raw value of the keywords field- Parameters:
keywordsField
- The keywordsField to set.
-
getKeywordTerms
Gets the keywords parsed into terms- Specified by:
getKeywordTerms
in interfaceISearchQuery
- Returns:
- array of keyword terms
-
getNormalizedKeywordTerms
Gets the keywords parsed into normalized terms- Specified by:
getNormalizedKeywordTerms
in interfaceISearchQuery
- Returns:
- array of normalized terms
-
getRefineFields
Return the map of refine fields- Specified by:
getRefineFields
in interfaceISearchQuery
- Returns:
- refine fields map
-
setRefineFields
Sets the refine field map- Parameters:
refineFields
- The refineFields to set.
-
populateFromSearchStateString
Import the search state from a state string- Specified by:
populateFromSearchStateString
in interfaceISearchQuery
- Parameters:
stateString
- the search state string (from toSearchStateString method)
-
toSearchStateString
Export the search state to a string- Specified by:
toSearchStateString
in interfaceISearchQuery
- Parameters:
options
- the options to use when writing the search state- Returns:
- search state as a string
-
cloneSearchQuery
Makes a clone of this search query- Specified by:
cloneSearchQuery
in interfaceISearchQuery
-
parseSearchTerms
Splits the given query string to search terms. The string is split at the spaces. If there are quotes in the string the text between the quotes is treated as a single term.- Parameters:
s
- the search query string- Returns:
- list of search terms
-
parseSearchTerms
Splits the given query string to search terms. The string is split at the spaces. If there are quotes in the string the text between the quotes is treated as a single term.- Parameters:
s
- the search query stringnormalize
- true to normalize the string before parsing, false otherwise- Returns:
- list of search terms
-
makeContainsTerm
Wrapps the value with wildcard characters- Parameters:
temp
- the value to wrap
-
hashCode
public int hashCode() -
equals
-