Solr function query to sort by slop phrase

For Solr 5.0.0, is there a way to sort the results by their phrase slope.

Example: if my search word laptop table

, my current results look like this:

  • dell inspiron laptop table
  • Dell laptop table.
  • laptop sony table
  • laptop for Dell laptop.

But it will look like:

  • Dell laptop table.
  • laptop for Dell laptop.
  • laptop sony table
  • dell inspiron laptop table

It should give first results that have the exact search word as they are, then results with one word between search words, then two, and so on. Is this possible in Solr?

+3


source to share


1 answer


Of course, use an actual phrasal query with slop . How:

"laptop table"~5

      



If your query is simple laptop table

, that is not being requested as a phrase at all, so their proximity to each other in the document has nothing to do with the search.

+1


source







All Articles