The Structured Query request aggregates the results of the individual queries into a final results list, using the retrieved index items.
Aggregation is controlled by operators on each individual query, using the following attribute:
<statement op="op
"
The op
value can be any one of the following:
Required
—The index items of the final results must have individual results from this query.Negative
—The index items of the final results must not have individual results from this query.Optional
—The index items of the final results are notrequired to have individual results from this query.
The default value is optional
. Note that required
queries should be executed first, then optional
queries, then negative
queries in order for the aggregation to work properly.
The relevance of the aggregated result is computed by combining the relevancies of the individual results, using the following attribute:
<statement weight="weight
"
The weight
value must be between 0 and 100, and represents the percentage of the total relevancy that comes from each query. The sum of all individual query weights should equal 100, excluding negative queries, which exclude results from prior required query matches.
Normally, each individual query is executing within different text fields, so the individual results are mutually exclusive. However, if multiple individual queries have overlapping text fields, the individual results might also overlap. This might be desired, but if the intent of the query was to use two different queries to find an index item which has two instances of a text field, a special mutual exclusion attribute is required:
<statement mutex="bool
"
The bool
value must be either true
or false
, which indicates whether the individual results must be mutually exclusive to prior individual results of the same index item. The default value is false
.