Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using ts_weight to impact search relevancy in Knowledge

servicenowkevin
ServiceNow Employee
ServiceNow Employee

Did you know that you can impact search relevancy by field weight in Knowledge? The Controlling Match Relevance by Field section of our documentation takes you through the basics of configuring your search relevancy at the field level. If you're interested in understanding search relevancy from an overall perspective, see Document Scoring.

The default field weighting is:

  • kb_knowledge.number = 50
  • kb_knowledge.short_description = 10
  • kb_knowledge.meta = 10
  • Every other field has a weight of 1 per occurrence and weighting increases exponentially for sequence matches.

At ServiceNow, we're using a weighting of:

  • kb_knowledge.number = 50
  • kb_knowledge.short_description = 15
  • kb_knowledge.meta = 10
  • Every other field has a weight of 1 per occurrence and weighting increases exponentially for sequence matches.

The difference for us is in the short description weighting (short description = article title). We find our result set improves with a greater focus on the short description. With strong titling standards, our titles are written to contain a quick overview of the issue, which should match the users search frequently.

We have been considering using a new field to allow certain articles to always appear at the top as "best bet" or "top suggestion" articles. For example, if a customer is searching on something related to LDAP issues, we may want this LDAP troubleshooting article to appear at the top of each result set because it provides the most comprehensive LDAP troubleshooting information in the knowledge base. To allow for this, we've considered using a custom SuperMeta field and providing a significant weight to that field. That would ensure that select content always appears at the top of results. We've played around with this in our personal test environments and it seems to work, but we haven't taken the idea any further. If we implemented this, we'd have to be very selective about what terms to use and how often the field would be used. If you were to over use that kind of feature, you'd ruin the overall search experience.

Have you changed the weighting for fields in Knowledge? What's working for you?

Let me know if you have search weight questions and I'll try to help you out.

27 REPLIES 27

Mark Laucus
Mega Guru

We are in the process of changing our weighting.   I think are best opportunities is the short description.   Could the KB number be dropped in weighting since it seems to be specifically referenced?


Mark Laucus in theory you can lower kb_number.weight. The search ordering may change because of the change to relevancy.


Here's a scenario for you:


  1. You have two KBs, KB1 and KB2.
  2. KB2 contains a reference to KB1.
  3. You perform a search for KB1.
  4. KB2 may be returned as a the top result because it has a reference to KB1.

#4 would be dependent on how much you change the weighting. If you only change it slightly, it likely won't matter too much, but if you dropped it to 10 or 15, you'd likely start to experience the scenario above (depending on your content).


And to add to Kevin's most excellent response, having that field more heavily weighted does no harm when there is no match.   I recommend you keep it highly weighted.


Scott Ferguson
ServiceNow Employee
ServiceNow Employee

servicenowkevin Love the Super Meta field idea.   I assume that means the data in the super meta is different that just the meta field. How are you currently using the meta field?   What are your thoughts on the ts_weight on the super field?