The structquery
element has no parent element, and contains the following child elements:
documentSets
parserOptions
refineConstraint
statement
The response to a structQuery
request is a document
element.
ATG Search indexes structured content by using XHTML to represent the structure. This allows ATG Search to perform fielded searches, meaning a query within a subset of the content of each index item, such as title. The standard query request can search within multiple fields, but it can not perform multiple searches within different sets of fields at the same time. This capability is useful for situations such as detecting duplicates within structured content. This capability requires a Structured Query request.
The major difference between the standard query request and the Structured Query request is that the structured query consists of multiple search input texts. Each search text is treated as a separate query with some of its own settings, including which fields to search within. This allows a structured query to search differently in different fields, taking advantage of the structure.
Note that although ATG Search performs multiple queries of structured content, only one result is returned to the user. Because each query can be on different text fields, there is no way to intersect the results at the statement level; instead, the structured query intersects results at the document level, aggregating statements from the same index item. Therefore, although each individual query retrieves statements, the final result list is focused on the retrieved index items.
The response object the same structure as the query
request, but each result contains all matching statement texts from each retrieved index item, and the relevancy is a weighted average of the individual relevancies.
Aggregation is controlled by a special operator on each individual query (see the statement
element). Individual queries must be sorted by the precedence of these operators, as shown below:
Required queries – final aggregate results (by index item) must have matched these queries.
Optional queries – final aggregate results may have matched these queries, and if so, their relevancies are affected.
Negative queries – final aggregated results may NOT have matched these queries. These queries effectively subtract results from the required matches.
Requests with statements in a different order will not return expected results.
The structQuery
element’s attributes are described in the sections that follow.