0

I am working on integrating Solr to my application. I have a List of keywords associated to each product. I use multivalued for Keyword field and indexed it. The problem is I want to Boost search result based on each item in the multivalued field in Solr index in order. (Currently I don't see order in the search result for multivalued field which I will fix it later.)

If I want to do this in my side I need to add different search fields and index them through Solr and set boost for each of them.

But I want to know if I use a list as multyvalued field in Solr can I do something like that without the cost of db schema change.

I am so new in Solr and if you find the question is so basic please give me any resource that gives me a hint to solve the problem. I am currently reading Apache Solr documentation and so far couldn't find anything that helps me.

sehe
  • 374,641
  • 47
  • 450
  • 633
Mehdi
  • 746
  • 1
  • 10
  • 25
  • So you want to apply a larger boost if the term `foo` is present earlier in the field `tags` (multivalued)? So `'foo', 'bar'` applies a larger boost than `'bar', 'foo'`? – MatsLindh Mar 02 '18 at 08:26
  • yes exactly. I need something to boost items within multivalued field based on their orders. – Mehdi Mar 03 '18 at 03:45
  • I don't think there's a proper way of doing that without changing your schema - one possible solution would be to have a dynamic field an have the query as part of the field name and with the associated boost, or using a payload with each token representing the position in the field and then boost on that. – MatsLindh Mar 06 '18 at 19:00
  • I don't have problem with changing schema. My problem is, I don't want to change my DB and Model to accommodate this logic. What about copyField, if I use 10 copyFields and populate them with elements of keyword list. And in solr query put boost on copyFields. In theory it should work but I need to work to how to implement it in Hybris which uses solrj as API client. – Mehdi Mar 07 '18 at 05:53

0 Answers0