This request attribute allows you to include feedback in the search response on searches that are performed using the and mode (see the mode attribute). If the full “and” of the search terms the user entered does not provide enough results, you can use the andFeedback results to arrive at a subset of terms that does provide results, and use that information in your results page to suggest alternate searches.

<query andFeedback="N">

N can have the following values:

  • N=0
    No feedback is returned.

  • N=1
    Only searches with 0 results generate feedback.

  • N>1
    Searches with fewer than the specified number of results generate feedback.

The feedback consists of alternate queries that provide all possible combinations of the terms from the original query that satisfy the Boolean and mode. An example of the response feedback follows:

<andFeedback>
<altQuery size="1" results="1808" text="women">
  <term exclude="false">women</term>
  <term exclude="true">of</term>
  <term exclude="true">apparel</term>
</altQuery>
<altQuery size="1" results="1329" text="apparel">
  <term exclude="true">women</term>
  <term exclude="true">of</term>
  <term exclude="false">apparel</term>
</altQuery>
</andFeedback>

The altquery child element includes the following attributes:

  • size—Number of non-excluded terms included in that subset of the query.

  • results—Approximate number of search results returned by that subset of the query.

  • text—Text of the non-excluded terms that comprise that subset of the query.

The altquery element includes one term child element for each of the original query terms. This makes it easy for you to display the original query and the excluded terms in a different format, if desired; to display only the included terms, refer to the text attribute.

The exclude attribute of the term element indicates whether the term has been excluded from that version of the query. In the above example, notice that “of” is automatically excluded in all and searches, due to its low value as a search term.

Note that if you are grouping by property and the refineCount=group attribute is in use (see Setting Grouping Options), the result counts returned reflect groups, not items.