Service Portal won't sort the search result correctly after upgrading indexing format to V4


After upgrading the indexing format from V3 to V4 the search functionality is not sorting the search results correctly on Service Portal (especially for Knowledge articles). When the customer is searching with the subject of the KB article, it is expected to show the exact matching article to come as the first in the list of Typeahead search in bold letters. However, upgrading to V4, the exact match comes somewhat below the list.


One primary reason is that the scoring of the articles. Typeahead search shows the articles with higher score evaluation at the beginning of the search results. Usually for KBs which matches the exact search terms should be at the top. However, during debugging (Debug Text Search) it is seen that some other articles are coming with a higher score than the exact match. 

As a fine-tuning approach (Document Scoring) to increase the score for the correct articles to come at the top, increment to the weight for short_descrption field was done from 50 to 100, still, no improvement was seen. The incorrect document would still have a higher scoring, and the exact match is having less, hence coming below.


In this scenario, below 2 changes are required.

1. Creating a system property.
glide.ts.bm25.phrase.boost ---- in sys_properties -- change to 20, default is 1. This makes search favours phrase more.

2. Adding an attribute to ts_configuration record for kb_knowledge.
ts_configuration --> kb_knowledge --> 'Text Index Table Attribute Map' related list --> bm25_b ---> added and changed to 0.2. BM25 favors short document, this property makes it less favor short document.

The customers can refer to the below document for more information:

Weight change done earlier or rebuilding the text index is not necessary for the fix to take effect.

Additional Information