Featured result: Query pipeline feature
Featured result: Query pipeline feature
The featured result query pipeline feature promotes specific items to the top of search results for particular queries.
You can configure a featured result statement in a query pipeline using the Result Rankings API.
Unlike ranking expression, which influences relevance scoring across all results, featured result targets specific items by identifier or query expression, and applies a large ranking boost to ensure those items appear first in the result list.
The following diagram shows the process of a query being sent to the Search API and the order of execution of query pipeline features.
How featured result works
When a featured result statement is applied in a query pipeline, the following happens:
When multiple items are promoted through the featured result feature, each promoted item receives a distinct ranking boost to preserve the declared order in the search results.
The first promoted item receives a boost of 100,000.
Each subsequent promoted item receives a boost that is 1,000 lower than the previous one, whether it’s listed later in the same statement or in a later statement.
This fixed gap between boost values guarantees that items appear in the intended order, regardless of their underlying relevance scores.
|
|
If the search interface applies a sort order other than On a case deflection, the By default, |
When and why to use featured result
The featured result feature affects relevance ranking only.
Use the featured result feature when you want to make sure that specific items appear at the top of search results for particular queries.
Some examples include:
-
Promoting troubleshooting articles: For known issues when users search for related error messages or symptoms.
-
Boosting help center content
Content that answers frequently asked questions for common query patterns.
-
Highlighting critical announcements
Service updates, security advisories, or maintenance notifications.
-
Surfacing curated content
Provide the most accurate or up-to-date information for specific topics.
|
|
Leading practice
A statement expressing the For example: Condition
Statement
|
Configuration options
When creating a featured result statement through the Result Rankings API, you can configure the following options:
-
matchQuery(default:false)When
true, thefeatured resultonly applies if the target item also matches the basic query (qparameter). Whenfalse, thefeatured resultis included regardless of whether it matches the query. -
matchAdvancedQuery(default:false)When
true, thefeatured resultonly applies if the target item also matches the advanced query (aqparameter). Whenfalse, thefeatured resultis included regardless of whether it matches the advanced query. -
includeInFacets(default:false)When
true,featured resultitems are included in facet calculations. Whenfalse,featured resultitems are excluded from facet computations.
|
|
Note
If you’re configuring The combined query expression is: The |
Syntax
Use the following query pipeline language (QPL) syntax to define a statement expressing the featured result feature:
featured result <targets>
<targets>
A comma-separated list of target specifications identifying which items to promote. Each target can be one of the following:
-
Query expression: A query expression such as
@urihash==valueor@permanentid=="id". Items matching this expression are promoted. -
Unique ID: A specific item identified by its unique ID. When you specify a unique ID, the system checks the following fields:
-
@urihash -
@permanentid -
@uri
-
An item matches if any of these fields contains the specified value.
Example
In this example, you want to promote two specific items to the top of results whenever a user searches for "product guide" in the Product Support query pipeline.
You first create a condition at the organization level with the following request:
Request:
POST /rest/search/v1/admin/pipelines/statements
Request body:
{
"definition": "when $query contains \"product guide\"",
"description": "Applies when query contains 'product guide'"
}
Response (excerpt):
{
"id": "45a7892e-a63f-4c8e-8795-ab38c8c18d7e"
}
You then create a featured result statement in the Product Support pipeline and associate it with the condition you created:
Request:
POST /rest/search/v1/admin/pipelines/{pipelineId}/statements
Request body:
{
"feature": "featured result",
"definition": "featured result `@urihash==a1b2c3d4e5f6`, `@permanentid==\"installation-guide-v2\"`",
"description": "Promote product guide items",
"parent": "45a7892e-a63f-4c8e-8795-ab38c8c18d7e"
}
The parent field links the statement to the condition.
The statement only applies when the condition is met.
When a user performs a query with the following payload, the statement applies:
{
"aq": "@contenttype==\"documentation\"",
"pipeline": "Product Support",
"q": "product guide installation"
}
Since this query goes through the Product Support query pipeline and satisfies the condition of the statement, the statement applies.
As a result, the different parts of the query expression are modified as follows:
-
dq(that is,$disjunctionQuery) becomes@urihash==a1b2c3d4e5f6 OR @permanentid=="installation-guide-v2". This modification includes items matching either of these expressions in the result set. -
q(that is,$query) remainsproduct guide installation. -
aq(that is,$advancedQuery) remains@contenttype=="documentation".
The two items specified in the featured result statement receive a significant ranking boost (starting at 100,000).
Additionally, the isTopResult property is set to true and the rankingModifier property is set to FeaturedResult for these items, which can be used by search interfaces to display them with special formatting or tracking.
The result set includes:
-
Items that match both the basic query (
product guide installation) AND are documentation content (because of theaqparameter). -
The featured result items (added through the
dqexpression modification).
The featured result items appear at the top of the result list due to their significantly boosted ranking scores, even if their relevance to the actual query is lower than other results.
What’s next
Test your featured result statement by performing queries that satisfy the associated conditions and verifying that the expected items are promoted in the search results.