2

I'm using Sitecore 9.3 and Solr 8.1.1, I have this simple query

q=itemName_t:(*test*)^80&fl=itemName_t,_templateID,score&fq=_indexname:(custom_index)&wt=xml

And these are the results:

  • item1 , templateID : template1ID, score : 80
  • item2 , templateID : template1ID, score : 80
  • item3 , templateID : template2ID, score : 80
  • item4 , templateID : template2ID, score : 80
  • item5 , tempalteID : tempalte3ID, score : 80

The results are mix of multiple templates, I wanted to boost only two templates types which are template1 and template2, So I wrote this query:

q=(_template:(**template1ID**)^60 OR _template:(**template2ID**)^60) AND itemName_t:(*test*)^80&fl=itemName_t,_templateID,score&fq=_indexname:(custom_index)&wt=xml

The results became like this:

  • item3 , templateID : template2ID, score : 215
  • item4 , templateID : template2ID, score : 215
  • item1 , templateID : template1ID, score : 90
  • item2 , templateID : template1ID, score : 90
  • item5 , tempalteID : tempalte3ID, score : 80

Although I boosted the two templates with the same value, template2 was boosted more higher than template1.

I enabled the solr explanation, but couldn't understand it.

8
  • 1
    We’ll need some clarification on a few things: 1. What are you attempting achieve with boosting? 2. Does the phrase test show up in any of the result item names? 3. Can you update your question to include the explain results from Solr? Commented Jun 3, 2022 at 22:58
  • @ChetCheeto I'm trying to boost two types of templates, as I have multiple templates at the search results. "test" is included at the item title always, it's at all the search results. Commented Jun 9, 2022 at 7:37
  • I need to mention that template1 has 855 items and template2 has only 8 items. Commented Jun 9, 2022 at 8:51
  • Are you using Solr Cloud? Commented Nov 2, 2022 at 22:01
  • @MarcelGruber yes I'm Commented Nov 3, 2022 at 6:22

1 Answer 1

0

The above query seems to be correct and the results also come as expected. Also would like to highlight that score is calculated not only based on the template only.

As I can see there are other parameters as well combined in boosting query, I would suggest having a look at the score formula on each result.

Please take solr debugger chrome extension - to get score. Hope this will help.

2
  • The solr debugger extension is removed. I've looked at the score formula, but still didn't get the full idea. Commented Jun 9, 2022 at 7:43
  • Add the score formula to your question, please.
    – x3mxray
    Commented Jul 6, 2022 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.