The form handler’s searchContext
property points to a component of class atg.search.formhandlers.SearchContext
. This component, which should be session-scoped, maintains information about the connection to Routing. By default, the searchContext
property of each form handler component is set to /atg/search/formhandlers/SearchContext
.
Routing
The SearchContext
component’s primaryConnection
property specifies the location of the DAF.Search.Routing
module that the search client is accessing. Accessing this module on the same Oracle ATG Web Commerce instance as the search client is called local Routing; accessing it on a different instance is called remote Routing. If you are using local Routing, primaryConnection
should be set to local
(the default). If you are using remote Routing, set primaryConnection
to:
rmi://hostname
:port
/atg/search/routing/SearchService
port
is the RMI port used by Oracle ATG Web Commerce (typically 8860). For example:
primaryConnection=rmi://myHost1:8860/atg/search/routing/SearchService
For remote Routing, you can use the SearchContext
component’s failoverConnections
property to specify an array of additional Routing instances to use if the primary instance fails. For example:
failoverConnections=rmi://myHost2:8860/atg/search/routing/SearchService,\
rmi://myHost3:8860/atg/search/routing/SearchService
The maxAttemptsBeforeFailover
property specifies the maximum number of times to attempt to access a specific Routing instance before failover. The default value is 2.
The SearchContext
component also has properties that control the firing of JMS messages when results are returned from a query. See JMS Event Handling for information.
SearchSession Object
The SearchContext
component has a searchSession
property that is set automatically to an object of class atg.search.client.SearchSession
. This object is used to store information that needs to persist between search requests. For example, for paging of results, the SearchSession
can keep track of the current page so that a subsequent request can determine what the next page is. The SearchSession
can even store the entire previous request, which is useful for contexts (such as faceted search and some paging options) where you might want to reissue a request with only minor changes.