1

I have a Solr core populated from products table in an ecom database. "Title" is a field in the core. Which is the best approach to get proper score/ranking? For example, if someone searches for "iPhone", the product with title "iPhone 6s" should get a score higher than one with "Beautiful case for iPhone 6, iPhone 7 and similar iPhones". Does Solr have some variation of levenstein distance which may help? Solr Version is 7.3. Clarification - both the values I mentioned, "iPhone 6s" and "Beautiful case for iPhone 6, iPhone 7 and similar iPhones" are in the same field - Title. If we take levenstein distance, "iPhone 6s" is closer to "iPhone" than "Beautiful case for iPhone 6, iPhone 7 and similar iPhones". Can this fact be put to use so that iPhoe 6s comes before the other one?

Jayadevan
  • 1,306
  • 2
  • 12
  • 33
  • Have a look at the answers to https://stackoverflow.com/questions/1752301/how-to-configure-solr-to-use-levenshtein-approximate-string-matching – kellyfj Mar 26 '19 at 14:12
  • You can give different "boost" values to each field, for example: `q=iphone&qf=title^10+description&defType=edismax` would give a bigger boost to matches on title vs matches on the description. – Hector Correa Mar 26 '19 at 15:45
  • You can start by setting `omitNorms` and if you're not doing phrase searches, `omitTermFreqAndPositions` on the field - this will disable any scoring based on field length and the number of occurences. – MatsLindh Mar 26 '19 at 20:03
  • 1
    @HectorCorrea - both values appear in Title column. Vendors keep repeating a term like "iPhone" many times in Title hoping that it will give them an edge in Search Engine Optimization. – Jayadevan Mar 27 '19 at 07:32
  • @MatsLindh - why to omit norms? in such cases norms will actually help since they will normalize the field score by the length of the field. – Tomer Arazy Mar 27 '19 at 15:19
  • @TomerArazy Err, of course. I got confused there for a second. – MatsLindh Mar 27 '19 at 21:25

0 Answers0