Adding Boost to Score According to Payload of Multivalued Field at Solr
Asked Answered
B

3

6

Here is my case;

I have a field at my schema named elmo_field. I want that elmo_field should have payloaded values. i.e.

dorothy|0.46  sesame|0.37  big bird|0.19 bird|0.22

When a user searches for a keyword i.e. dorothy I want to add 0.46 to usual score. If user searches for big bird, 0.19 should be added and if user searches for bird, 0.22 should be added (payloads are added - or payloads * normalize coefficient will be added).

I mean I will make a search on my index at my other fields of solr schema. And I will make another search (this one is an exact match search) at elmo_field at same time and if matches something I will increase score with payloads.

Any ideas?

Burleigh answered 24/11, 2013 at 18:2 Comment(2)
Have you read the following articles related to payload in misc solr version? solr 2.x payloads solr 3.x payloads solr 4.x payloadsCirrostratus
See my comment here, I think that's what you are trying to achieve https://mcmap.net/q/1918271/-is-it-possible-to-apply-a-solr-document-int-field-value-as-boost-value-if-a-specific-field-is-matchedFortyfive
B
1

I've implemented a custom similarity wrapper. For usual things I've used DefaultSimilarity. If a field is a payloaded field another similarity that is implemented by me is used. That similarity class just ignores payload value. I've also implemented a query parser that is a customized version of edismax. With that approach I could add payload value into the document score.

Burleigh answered 17/12, 2013 at 11:34 Comment(1)
Are you using solr 4.x?? I am assuming you are, I wrote a payloads version of edismax for solr 3.x several years ago, and I was hoping that the 4.x version of edismax would allow for the payload score to be added to the overall score. Would you be willing to make your version of the edismax for payloads opensource, I do not feel like writing it all over again, plus I could help contribute to it and I am sure others would too.Kalgoorlie
T
0

Have you looked at CustomScoreQuery?

There's an example with some explanation how to do this at http://dev.fernandobrito.com/2012/10/building-your-own-lucene-scorer/

Tamalatamale answered 3/12, 2013 at 9:50 Comment(0)
P
0

You could do a boost on a query as this question suggests: How to assign a weight to a term query in Lucene/Solr

Or you could try using payloads as described here: http://searchhub.org/2009/08/05/getting-started-with-payloads/

Pyrotechnics answered 4/12, 2013 at 16:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.