Configuring document attributes for boosting in Amazon Q Business
To boost specific documents for end user queries using document attributes, you can use the AWS Management Console or the DocumentAttributeBoostingConfiguration parameter of the UpdateRetriever API operation.
Note
For STRING
and STRING_LIST
type document attributes
to be used for boosting on the console and the API, they must be enabled for
search using the DocumentAttributeConfiguration
object of the UpdateIndex API operation. If
you don't enable search on these attributes, you can't boost attributes of these
data types on either the console or the API.
The following tabs provide a procedure to boost document attributes using the console and code examples for the AWS CLI.
- Console
-
To boost document attributes
-
Sign in to the AWS Management Console and open the Amazon Q Business console.
-
In Applications, select the name of your application environment from the list of applications.
-
From the left navigation menu, choose Metadata boosting.
-
In Metadata boosting, choose the document attribute type that you want to boost.
Note
You can boost attributes using the following values: None, Low, Medium, High, and Very high.
Choose from the following options:
-
Popular – Amazon Q displays the following popularly boosted document attributes for you to choose from:
-
Document title – Use to boost the title of a document. You can also use Advanced settings to boost specific document titles. By default, the document title attribute is enabled for search with a value of
Low
. You can change this value when you customize boosting. -
Last updated – Use to boost content by its last updated date. You can also use Advanced settings to configure Boosting duration, or how long your boost should apply.
-
File type – Use to boost content by file type.
-
Data sources – Use to boost the content data source type.
-
To save your configuration, choose Save.
-
-
Text – Use to boost
STRING
andSTRING_LIST
type reserved or custom document attributes that you have enabled for search. Then, choose Save. -
Date – Use to boost content using
DATE
type reserved or custom document attributes. For example, use the Created at document attribute to boost content based on recency. You can also use Advanced settings to configure Boosting duration, or how long your boost should apply. Then, choose Save. -
Numeric – Use to boost content using
NUMERIC
type reserved or custom attributes. For example, use the View count document attribute to boost content based on view count. Based on your boosting needs, choose either Prioritize higher values or Prioritize lower values. Then, choose Save. -
Once done, you can select View web experience to check boosting. Your configured web experience will open in a new window.
-
-
- AWS CLI
-
Update your Amazon Q Business index to apply boosting
This example shows how to apply
VERY_HIGH
boosting for theSTRING
type document attribute_document_title
.aws qbusiness update-retriever \ --application-id
APPLICATION-ID
--retriever-idRETRIEVER-ID
\ --configuration '{ "nativeIndexConfiguration": { "indexId": "INDEX-ID
", "boostingOverride": { "_document_title": { "stringConfiguration": { "boostingLevel": "VERY_HIGH" } } } } }'This example shows how to appy boosting for the
STRING
type attribute_category
, theDATE
type attribute_created_at
, theNUMBER
type attribute_view_count
, and theSTRING_LIST
type attribute_authors
.aws qbusiness update-retriever \ --application-id
APPLICATION-ID
--retriever-idRETRIEVER-ID
\ --configuration '{ "nativeIndexConfiguration": { "indexId": "INDEX-ID
", "boostingOverride": { "_category": { "stringConfiguration": { "boostingLevel": "LOW", "attributeValueBoosting": { "HR": "MEDIUM" } } }, "_created_at": { "dateConfiguration": { "boostingLevel": "LOW", "boostingDurationInSeconds": 2592000 } }, "_view_count": { "numberConfiguration": { "boostingLevel": "LOW", "boostingType": "PRIORITIZE_SMALLER_VALUES" } }, "_authors": { "stringListConfiguration": { "boostingLevel": "HIGH" } } } } }'Update your Amazon Q Business retriever to remove any existing boosts
This example shows how to remove any existing boosts from document attributes in your retriever.
aws qbusiness update-retriever \ --application-id
APPLICATION-ID
--retriever-idRETRIEVER-ID
\ --configuration '{ "nativeIndexConfiguration": { "indexId": "INDEX-ID
" } }'Get details about your Amazon Q Business retriever boosts
This example shows how to get details for your existing boosting configuration
aws qbusiness get-retriever \ --application-id
APPLICATION-ID
--retriever-idRETRIEVER-ID