Normally, Oracle ATG Web Commerce Search treats each user query as a separate isolated request, with no pre-existing state or context. However, many user searches are interrelated, and you may want to provide context. Search captures several types of search context in its query request XML, and it is controlled by the following special element and attribute:

<query requestMode="mode"
<priorInput>context</priorInput>

The mode value specifies how the context string in the priorInput element is interpreted, and can be one of the following values:

The subtract modes represent the search scenario known as not like this, where the end-user does a search that returns relevant but poor results, and then directs the system to find results not like the poor results.

The penalize modes represent the search scenario known as less like this, where the end-user does a search that returns relevant but poor results, and then directs the system to find results less like the poor results, but not necessarily eliminating them.

The within modes represent the search scenario known as search within, where the end-user does a search that returns generally relevant results, and then directs the system to find results of a new query within those initial results.