|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.search.routing.command.SearchXMLObject atg.search.routing.command.SearchEngineRequestImpl atg.search.routing.command.search.SearchRequest
public abstract class SearchRequest
All search requests extend this. Indexing and Deploy requests do not. Maintains a few select properties that are common to all search requests.
Field Summary | |
---|---|
static int |
BROWSE
|
protected static char[] |
CACHEABLE
|
static int |
CATEGORIZE
|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static char[] |
DEBUG
|
protected static java.lang.String[] |
EMPTY_ARRAY
|
protected static char[] |
ENV
|
protected static char[] |
ID
|
static int |
INSPECT
|
protected static char[] |
LIST_PROPERTY_ALLOWED
|
protected static char[] |
LOCAL_MERGE
|
protected static char[] |
LOCAL_MERGE_DEBUG
|
protected static char[] |
LOG_THIS_REQUEST
|
protected java.lang.Boolean |
mDebug
engine debugging |
protected boolean |
mListPropertyAllowed
to support list properties in the results. |
protected boolean |
mLocalMergeDebugEnabled
Java merge debugging. |
protected boolean |
mLocalMergeDebugReady
Java merge debugging ready. |
protected boolean |
mLocalMergeEnabled
Controls local merge. |
protected java.lang.String |
mMergeSettings
response number settings for merge |
protected boolean |
mMultiPartitionSearch
indicates a multiple partition search. |
protected java.lang.String |
mRequestIdentifier
uniquely identifies this request. |
protected static double |
MsInNs
|
protected java.lang.Integer |
mSleepTimeMs
forces the engine to go to sleep during the call, for testing timeouts |
protected atg.search.routing.SearchTargetNames |
mTargets
combined object for all search target names--environment, LPs, and excluded LPs |
protected static char[] |
MULTI_PARTITION
|
protected static char[] |
MULTI_SEARCH_SESSION
|
protected java.lang.String |
mVersion
engine version, not used |
static int |
QUERY
|
protected static char[] |
SAVE_REQUEST
|
static int |
SIMILARDOCS
|
protected static char[] |
SLEEP_TIME_MS
|
static int |
STRUCTQUERY
|
static java.lang.String[] |
TAGS
XML tags for the different requests. |
protected static char[] |
TIME
|
static int |
TREEQUERY
|
static int |
TYPEAHEAD
|
protected static char[] |
VERSION
|
static int |
VIC
|
Constructor Summary | |
---|---|
SearchRequest()
|
Method Summary | |
---|---|
protected SearchResponse |
doMerge(java.util.List<SearchResponse> pParsedResponses)
Default implementation returns the first element of the array and tosses the rest. |
protected void |
fromXml(atg.search.routing.utils.FastXMLModel pXml,
int pRootIdx)
populates common attributes from xml. |
protected void |
getAllAttributeXML(java.lang.StringBuilder cmd)
Inserts attributes for all commands. |
java.lang.String |
getAssociatedRequestIdentifier()
This is typically a search request that came before a ViewDocument request. |
java.lang.Boolean |
getDebug()
Indicates whether debugging should be enabled for this request on the engine |
java.util.List |
getExcludeLogicalPartitionNames()
Returns the List of excluded Logical Partition names |
SearchResponse |
getLastResponse()
Returns the last response. |
java.util.List |
getLogicalPartitionNames()
Returns the List of targeted Logical Partitions' names |
int |
getMaximumResults()
This is only for JSPs that might want to keep the number of results with the request. |
java.lang.String |
getMergeSettings()
This is not part of a regular request. |
java.lang.String |
getPreviousRequestChainToken()
Returns the identifier for the previous chain of requests. |
java.lang.String |
getRequestAttribute(java.lang.Object attributeName)
provided for compatibility. |
java.util.Map |
getRequestAttributes()
provided for compatibility, but a no-op, and returns null. |
java.lang.String |
getRequestChainToken()
a unique identifier for a chain of requests. |
abstract int |
getRequestId()
This identifies the type of request, one of QUERY , BROWSE , etc. |
java.lang.String |
getRequestIdentifier()
The request id is available after Routing has processed the request. |
java.lang.String |
getRequestTag()
Gets the xml element tag used in the request |
long |
getRequestTime()
The time of day that the request occured, in milliseconds since 1970. |
java.lang.String |
getSearchEnvironmentName()
Returns the target search environment name, which may be null. |
atg.search.routing.SearchTargetNames |
getSearchTargetNames()
Returns the search target names for this request. |
java.lang.String |
getSiteId()
This is a client-side value provided for reporting purposes that identifies the site. |
java.lang.Integer |
getSleepTimeMs()
Returns the amount of time, in ms, that the engine should sleep upon receiving this call. |
java.lang.String |
getUserAgent()
Returns the user-agent string, if one was provided, or null |
java.lang.String |
getVersion()
Optional version string for the request type. |
boolean |
isCacheable()
If cacheable is false, no attempt will be made to satisfy this request from cached data, nor will the results of this request be added to the cache. Will also return false if test-oriented values are set. |
boolean |
isKeepingXml()
RoutingSearchService (in Routing) will provide the full XML in both the original encoded form and the decoded form, along with individual partition responses, if this is enabled. |
boolean |
isListPropertyAllowed()
If true, expect Lists from the Result's properties HashMap. |
boolean |
isLocalMergeDebugEnabled()
Results in two requests being sent: one with Java merge, one without. |
boolean |
isLocalMergeDebugReady()
Indicates whether the local merge debugging comparison is ready. |
boolean |
isLocalMergeEnabled()
Indicates whether local merge is enabled for this request. |
boolean |
isMultiPartitionSearch()
Indicates whether this is a multi-partition search. |
boolean |
isMultiSearchSession()
Indicates if this request is part of a multi-search session |
boolean |
isPagingRequest()
When the request originated in a form handler, this will indicate whether this is a paging request. |
boolean |
isSaveRequest()
Indicates whether this will be saved for paging |
SearchResponse |
merge(java.util.List<SearchResponse> pParsedResponses)
Invokes local merge on the parsed responses. |
atg.search.routing.command.SearchEngineCommandResponse |
processResponse(atg.search.routing.command.SearchEngineResponse response)
Executes and times search response processing. |
protected SearchResponse |
processSearchResponse(atg.search.routing.command.SearchEngineResponse response)
Override to provide search response processing (parsing, generally). |
void |
setAssociatedRequestIdentifier(java.lang.String pAssociatedRequestIdentifier)
This is typically the identifier for a search request that came before a ViewDocument request. |
void |
setCacheable(boolean pCacheable)
If cacheabe is false, no attempt will be made to satisfy this request from cached data, nor will the results of this request be added to the cache. |
void |
setDebug(java.lang.Boolean debug)
Indicates whether debugging should be enabled for this request on the engine |
void |
setExcludeLogicalPartitionNames(java.util.List pExcludeLogicalPartitionNames)
Sets the logical partition names to exclude for this request. |
void |
setKeepingXml(boolean pKeepingXml)
RoutingSearchService (in Routing) will provide the full XML in both the original encoded form and the decoded form, along with individual partition responses, if this is enabled. |
void |
setLastResponse(SearchResponse pLastResponse)
Sets the last response for debugging local vs. |
void |
setListPropertyAllowed(boolean listPropertyAllowed)
Enables storage of multi-valued properties in the Result's properties HashMap. |
void |
setLocalMergeDebugEnabled(boolean pLocalMergeDebugEnabled)
Sets whether local merge debugging is enabled for this request |
void |
setLocalMergeDebugReady(boolean pLocalMergeDebugReady)
Sets whether local merge debugging comparison is ready for this request |
void |
setLocalMergeEnabled(boolean pLocalMergeEnabled)
Controls whether local merge is enabled for this request. |
void |
setLogicalPartitionNames(java.util.List pLogicalPartitionName)
Sets the logical partition names for this request. |
void |
setMaximumResults(int pMaxResults)
This is only for JSPs that might want to keep the number of results with the request. |
void |
setMergeSettings(java.lang.String mergeSettings)
This is not part of a regular request. |
void |
setMultiPartitionSearch(boolean multiPartitionSearch)
Indicates whether this is a multi-partition search. |
void |
setMultiSearchSession(boolean pMultiSearchSession)
Call this if you anticipate having multiple, independent form handler searches sharing the same HTTP session. |
void |
setPagingRequest(boolean pPagingRequest)
Set this to true to indicate that this is only being used for paging. |
void |
setPhysicalPartitionId(java.lang.String pPhysicalPartitionId)
Sets the ID of the physical partition to restrict the search to. |
void |
setPreviousRequestChainToken(java.lang.String pPreviousRequestChainToken)
Sets the identifier for the previous chain of requests. |
void |
setRequestAttribute(java.lang.Object attributeName,
java.lang.Object attributeValue)
provided for compatibility. |
void |
setRequestAttributes(java.util.Map requestAttributes)
provided for compatibility. |
void |
setRequestChainToken(java.lang.String pRequestChainToken)
Sets a unique identifier for a chain of requests. |
void |
setRequestIdentifier(java.lang.String pRequestIdentifier)
This is called automatically by Routing. |
void |
setRequestTime(long pRequestTime)
Sets the time of request in milliseconds (as in the time of day). |
void |
setSaveRequest(boolean pSaveRequest)
Causes this request to be saved in session scope for paging purposes. |
void |
setSearchEnvironmentName(java.lang.String pSearchEnvironmentName)
Sets the environment target for this request. |
void |
setSiteId(java.lang.String pSiteId)
This is a client-side value provided for reporting purposes. |
void |
setSleepTimeMs(java.lang.Integer pSleepTimeMs)
Sets the amount of time, in ms, that the engine should sleep upon receiving this call. |
void |
setUserAgent(java.lang.String pUserAgent)
Sets the optional user agent string. |
void |
setVersion(java.lang.String version)
Optional version string for the request type. |
Methods inherited from class atg.search.routing.command.SearchEngineRequestImpl |
---|
encodeMapData, isFiringSearchEvents, isKeepingResponseData, isLoggingThisRequest, setFiringSearchEvents, setKeepingResponseData, setLoggingThisRequest |
Methods inherited from class atg.search.routing.command.SearchXMLObject |
---|
appendComplexXml, appendOptionalAttr, appendOptionalElem, appendOptionalElem, appendOptionalElem, appendRequiredAttr, appendRequiredElem, appendRequiredElem, appendRequiredValue, getAllBodyXML, getAttributeXML, getBodyXML, getDefaultXmlBytes, getParentXMLObject, getXmlPath, setParentXMLObject, toString, toXML, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface atg.search.routing.command.SearchEngineRequest |
---|
toXML |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static java.lang.String[] EMPTY_ARRAY
protected java.lang.String mRequestIdentifier
protected atg.search.routing.SearchTargetNames mTargets
protected boolean mListPropertyAllowed
protected boolean mMultiPartitionSearch
protected boolean mLocalMergeEnabled
protected boolean mLocalMergeDebugEnabled
protected boolean mLocalMergeDebugReady
protected java.lang.String mMergeSettings
protected java.lang.String mVersion
protected java.lang.Boolean mDebug
protected java.lang.Integer mSleepTimeMs
protected static final double MsInNs
public static final int QUERY
public static final int BROWSE
public static final int STRUCTQUERY
public static final int VIC
public static final int SIMILARDOCS
public static final int CATEGORIZE
public static final int INSPECT
public static final int TREEQUERY
public static final int TYPEAHEAD
public static final java.lang.String[] TAGS
protected static final char[] VERSION
protected static final char[] MULTI_PARTITION
protected static final char[] DEBUG
protected static final char[] SLEEP_TIME_MS
protected static final char[] ID
protected static final char[] TIME
protected static final char[] LIST_PROPERTY_ALLOWED
protected static final char[] ENV
protected static final char[] LOCAL_MERGE
protected static final char[] LOCAL_MERGE_DEBUG
protected static final char[] SAVE_REQUEST
protected static final char[] LOG_THIS_REQUEST
protected static final char[] MULTI_SEARCH_SESSION
protected static final char[] CACHEABLE
Constructor Detail |
---|
public SearchRequest()
Method Detail |
---|
public java.lang.String getRequestTag()
getRequestTag
in interface atg.search.routing.command.SearchEngineRequest
getRequestTag
in class atg.search.routing.command.SearchXMLObject
public java.lang.String getRequestIdentifier()
public void setRequestIdentifier(java.lang.String pRequestIdentifier)
pRequestIdentifier
- the unique id for this requestpublic void setCacheable(boolean pCacheable)
pCacheable
- pass true to enable caching, false to disablepublic boolean isCacheable()
public void setRequestTime(long pRequestTime)
pRequestTime
- current time in millisecondspublic long getRequestTime()
public int getMaximumResults()
public void setMaximumResults(int pMaxResults)
pMaxResults
- maximum number of results to displaypublic java.lang.String getUserAgent()
public void setUserAgent(java.lang.String pUserAgent)
pUserAgent
- user agent stringpublic boolean isLocalMergeEnabled()
public void setLocalMergeEnabled(boolean pLocalMergeEnabled)
pLocalMergeEnabled
- whether local merge is enabled for this requestpublic boolean isLocalMergeDebugEnabled()
public void setLocalMergeDebugEnabled(boolean pLocalMergeDebugEnabled)
pLocalMergeDebugEnabled
- whether local merge debugging is enabled for this requestpublic boolean isLocalMergeDebugReady()
public void setLocalMergeDebugReady(boolean pLocalMergeDebugReady)
pLocalMergeDebugReady
- whether local merge debugging comparison is ready for this requestpublic boolean isPagingRequest()
public void setPagingRequest(boolean pPagingRequest)
setSaveRequest(boolean)
.
pPagingRequest
- true to indicate that this is a paging request.public boolean isSaveRequest()
public void setSaveRequest(boolean pSaveRequest)
pSaveRequest
- if true, will be saved in session scope by the form handlerpublic boolean isMultiSearchSession()
public void setMultiSearchSession(boolean pMultiSearchSession)
SearchResponse.getRequestChainToken()
;
on subsequent searches, you must pass that id to setRequestChainToken(String)
.
pMultiSearchSession
- whether this request will be used in a multi-search sessionpublic atg.search.routing.SearchTargetNames getSearchTargetNames()
getSearchEnvironmentName()
, getLogicalPartitionNames()
,
getExcludeLogicalPartitionNames()
, along with the corresponding setters.
public void setSearchEnvironmentName(java.lang.String pSearchEnvironmentName)
pSearchEnvironmentName
- environment name (not a repository id)public java.lang.String getSearchEnvironmentName()
public void setLogicalPartitionNames(java.util.List pLogicalPartitionName)
pLogicalPartitionName
- List of Stringpublic java.util.List getLogicalPartitionNames()
public void setExcludeLogicalPartitionNames(java.util.List pExcludeLogicalPartitionNames)
pExcludeLogicalPartitionNames
- List of Stringpublic java.util.List getExcludeLogicalPartitionNames()
public void setPhysicalPartitionId(java.lang.String pPhysicalPartitionId)
ViewDocumentRequest
s only,
and even in that case never needs to be set by the caller.
pPhysicalPartitionId
- ID of physical partition to restrict the search to. This is for ViewDocument requests,
and never needs to be set by the caller.public boolean isKeepingXml()
public void setKeepingXml(boolean pKeepingXml)
pKeepingXml
- whether XML will be included in the responseSearchEngineCommandResponse.getSearchEngineResponse()
,
SearchEngineResponse.getXmlResponse()
,
SearchEngineResponse.getXmlResponseDecoded()
public java.lang.String getAssociatedRequestIdentifier()
setAssociatedRequestIdentifier(String)
on the that request.
public void setAssociatedRequestIdentifier(java.lang.String pAssociatedRequestIdentifier)
setAssociatedRequestIdentifier(String)
on the that request.
pAssociatedRequestIdentifier
- the associated request's identifierpublic java.lang.String getSiteId()
public void setSiteId(java.lang.String pSiteId)
pSiteId
- the site being searched.public abstract int getRequestId()
QUERY
, BROWSE
, etc.
public java.lang.String getVersion()
public void setVersion(java.lang.String version)
version
- version stringpublic java.lang.Boolean getDebug()
public void setDebug(java.lang.Boolean debug)
debug
- whether debugging should be enabled in the enginepublic java.lang.Integer getSleepTimeMs()
public void setSleepTimeMs(java.lang.Integer pSleepTimeMs)
SearchEngineService.getReadTimeoutMs()
) is 20000ms, then the call will timeout.
pSleepTimeMs
- the amount of time, in ms, that the engine should sleep upon receiving this callpublic java.util.Map getRequestAttributes()
getRequestAttributes
in interface atg.search.routing.command.SearchEngineRequest
getRequestAttributes
in class atg.search.routing.command.SearchEngineRequestImpl
public java.lang.String getRequestAttribute(java.lang.Object attributeName)
getRequestAttribute
in interface atg.search.routing.command.SearchEngineRequest
getRequestAttribute
in class atg.search.routing.command.SearchEngineRequestImpl
attributeName
-
public void setRequestAttributes(java.util.Map requestAttributes)
setRequestAttributes
in interface atg.search.routing.command.SearchEngineRequest
setRequestAttributes
in class atg.search.routing.command.SearchEngineRequestImpl
requestAttributes
- public void setRequestAttribute(java.lang.Object attributeName, java.lang.Object attributeValue)
setRequestAttribute
in interface atg.search.routing.command.SearchEngineRequest
setRequestAttribute
in class atg.search.routing.command.SearchEngineRequestImpl
attributeName
- attributeValue
- public java.lang.String getMergeSettings()
public void setMergeSettings(java.lang.String mergeSettings)
mergeSettings
- merge settingspublic boolean isMultiPartitionSearch()
public void setMultiPartitionSearch(boolean multiPartitionSearch)
multiPartitionSearch
- whether this is for multiple partitionspublic boolean isListPropertyAllowed()
public void setListPropertyAllowed(boolean listPropertyAllowed)
listPropertyAllowed
- true to enable list propertiesprotected final void getAllAttributeXML(java.lang.StringBuilder cmd) throws atg.search.routing.command.IncompleteCommandException
fromXml(atg.search.routing.utils.FastXMLModel,int)
.
Fills the provided buffer with the complete attribute XML for the command.
getAllAttributeXML
in class atg.search.routing.command.SearchXMLObject
atg.search.routing.command.IncompleteCommandException
protected final void fromXml(atg.search.routing.utils.FastXMLModel pXml, int pRootIdx)
QueryRequest.fromXml(atg.search.routing.utils.FastXMLModel)
.
These should be the same attributes inserted into the outbound XML in
getAllAttributeXML(StringBuilder)
.
pXml
- populated xml parserpRootIdx
- starting index for this request typeprotected SearchResponse processSearchResponse(atg.search.routing.command.SearchEngineResponse response) throws atg.search.routing.command.RoutingCommandException
response
- the engine response
atg.search.routing.command.RoutingCommandException
processResponse(atg.search.routing.command.SearchEngineResponse)
public final atg.search.routing.command.SearchEngineCommandResponse processResponse(atg.search.routing.command.SearchEngineResponse response) throws atg.search.routing.command.RoutingCommandException
processResponse
in interface atg.search.routing.command.SearchEngineRequest
processResponse
in class atg.search.routing.command.SearchEngineRequestImpl
response
- the response from the engine
atg.search.routing.command.RoutingCommandException
protected SearchResponse doMerge(java.util.List<SearchResponse> pParsedResponses) throws atg.search.routing.MergeException
pParsedResponses
- parsed responses
atg.search.routing.MergeException
public final SearchResponse merge(java.util.List<SearchResponse> pParsedResponses) throws atg.search.routing.MergeException
pParsedResponses
- parsed responses
atg.search.routing.MergeException
public void setRequestChainToken(java.lang.String pRequestChainToken)
SearchResponse.getRequestChainToken()
.
See setPreviousRequestChainToken(String)
, which must be called on search requests.
pRequestChainToken
- unique identifier, often the requestIdentifier from the first response in the chain.public java.lang.String getRequestChainToken()
public java.lang.String getPreviousRequestChainToken()
setRequestChainToken(String)
and setPreviousRequestChainToken(String)
.
When available, this value is used internally to clear out the old request chain data when a new
request chain begins.
public void setPreviousRequestChainToken(java.lang.String pPreviousRequestChainToken)
setRequestChainToken(String)
is used, as the previous token provides the only means of cleaning up old request chain data once a new request chain
is started. Example: User asks a question and pages through a few pages. Then the user types in a new question and clicks Search.
The initial request establishes the request chain, and the subsequent paging requests associate data with it. The new
question establishes a new request chain. The old request chain data will remain in the session unless it is
cleared, but it can only be accessed with the old token. Thus, the best practice is to examine the search response
at the top of your search page: if you have one, then set previousRequestChainToken using the value; if you do not have
a response, then there is nothing to set.
This ensures that the next request, if it happens to be a new request and not merely a paging or faceted navigation request,
will clear out the old request data.
pPreviousRequestChainToken
- unique identifier, often the requestIdentifier from the first response in the chain.public void setLastResponse(SearchResponse pLastResponse)
isLocalMergeDebugEnabled()
is true.
pLastResponse
- the last responsepublic SearchResponse getLastResponse()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |