Sort results by relevance using Solr search

I am new to Solr and trying to figure out how to handle ordering of results. I use Ruby on Rails with the Sunspot Stone to interact with Solr.

I have an article model that has the following indexes:

text Title text AuthorNames integer NumberOfReviews 

I would like to be able to search on Solr, where:

  • Exact match matches return before anything else
  • Positive weighting is given in proportion to articles with larger NumberOfReviews

Ideally, I would also like to be able to do something like Google, where glare and typos are detected to some extent, and alternative searches are offered when it seems that the user made a mistake, although I'm not sure if this is possible.

Can someone help or point me in the right direction? Thanks in advance!

+4
source share
1 answer
  • β€œWeighing” is usually called β€œgain” in the Sol / Lutsen jargon.
  • Look at debugging queries and its parameters , there are many settings that you can do there. For example, you can use the bf parameter to increase articles with larger NumberOfReviews.
  • Error checking, alternative suggestions: see SpellCheckComponent
+7
source

All Articles