Field Notes: How to Boost Your Search Results Using Relevance Tuning with Amazon Kendra
AWS Architecture BlogField Notes: How to Boost Your Search Results Using Relevance Tuning with Amazon Kendraby Sam Palani | on31 AUG 2021| inAmazon Kendra,Architecture,Technical How-to|Permalink|ShareOne challenge enterprises face when they implement an intelligent search solution for their large data sources, is the ability to quickly provide relevant search results. When working with large data sources, not all features or attributes within your data will be equally relevant to all your users. We want to prioritize identifying and boosting specific attributes for your users to provide the most relevant search results.Relevance inAmazon Kendratuning allows you to give a boost to a result in the response when the query includes terms that match the attribute. For example, you might have two similar documents but one is created more recently. A good practice is to boost the relevance for the newer (or earlier) document.Relevance tuning in Amazon Kendra can be performed manually at the Index level or at the query level. In this blog post, we show how to tune an existing index that is connected to external data sources, and ultimately optimize your internal search results.Solution overviewWe will walk through how you can manually tune your index using boosting techniques to achieve the best results. This enables you to prioritize the results from a specific data source so your users get the most relevant results when they perform searches.Figure 1. Amazon Kendra setupFigure 1 illustrates a standard Amazon Kendra setup. An Amazon Kendra index is connected to different Amazon Simple Storage Service (Amazon S3) buckets with multiple data sources.There are two types of user personas. The first persona is administrators who are responsible for managing the index and performing administrative tasks such as access control, index tuning, and so forth. The second persona is users who access Amazon Kendra either directly or through a custom application that can make API search requests on an Amazon Kendra index. You can use relevance tuning to boost results from one of these data sources to provide a more relevant search result.PrerequisitesThis solution requires the following:AWS accountIAM users androlesAmazon Kendra indexAmazon Kendra data sourcethat is synced and availableIf you do not have these prerequisites set up, you might check outCreate and query an indexthat walks you through how to create and query an index in Amazon Kendra.Furthermore, the AWS services you use in this tutorial are within theAWS Free Tierunder a 30-day trial.Step 1 – Check facet definitionFirst, review your facet definition and confirm it is facetable, displayable, searchable, and sortable.In the Amazon Kendra console, select your Amazon Kendra index, then selectFacet definitionin theData managementpanel. Confirm that_data_source_idhas all of its attributes checked.Figure 2. Check facet definitionStep 2 – Review data sourcesNext, verify that you have at least two data sources for your Amazon Kendra index.In the Amazon Kendra console, select your Amazon Kendra index, and then selectData sourcesin theData managementpanel. Confirm that your data sources are correctly synced and available. In our example, data-source-2 is an earlier version and contains unprocessed documents compared to sample-datasource that has newer versions and has more relevant content.Figure 3. Verify data sourcesStep 3 – Perform a regular Amazon Kendra searchNext, we will test a regular search without any relevance tuning. SelectSearch console, and enter the search termAmazon Kendra VPC. Review your search results.Figure 4. Regular Amazon Kendra searchIn our example search results, the document from the second data source39_kendra-dg_kendra-dgappears as the third result.Step 4 – Relevance tuning through boostingNow we will boost the first data source so documents from the first data source are displayed ahead of the other data sources.Selectdata source, and boost the first data sourcesample-datasourceto 8. Press theSavebutton to save your tuning. Wait several seconds for the changes to propagate.Figure 5. Boost sample-datasourceStep 5 – Perform the search after boostingNext, we will test the search with relevance tuning applied. In the search text box enter the search termAmazon Kendra VPC. Review your search results.Figure 6. Searching after boostingNotice that the search result no longer contains the document from the second data source.Cleaning upTo avoid incurring any future charges, remove any index created specifically for this tutorial. In the Amazon Kendra console, select your index. Then selectActions, and chooseDelete.Figure 7. Delete indexConclusionIn this blog post, we showed you how relevance tuning can be used to produce results ranked by their relevance. We also walked you through an example regarding how to manually perform relevance tuning at the index level in Amazon Kendra to boost your search results.In addition to relevance tuning at the index level, you can also performrelevance tuning at the query level. Finally, check out theWhat is Amazon Kendra?andRelevance tuning with Amazon Kendrablog posts to learn more.TAGS:Field NotesSam PalaniSam Palani is an AI/ML Specialist Solutions Architect at AWS. He works with public sector customers to help them architect and implement machine learning solutions at scale. When not helping customers, he enjoys long hikes, unwinding with a good book, listening to his classical vinyl collection and building with Raspberry Pi
One challenge enterprises face when they implement an intelligent search solution for their large data sources, is the ability to quickly provide relevant search results. When working with large data sources, not all features or attributes within your data will be equally relevant to all your users. We want to prioritize identifying and boosting specific […]
Sam Palani
Amazon Kendra Architecture Technical How-to