0
votes

I would like to sort solr documents based on searched term. For example the search term is "stringABC"

Then the order of the results should be

stringABC, stringABCxxxx, xxxxstringABCxxxx

The solr document will contain lot of fileds ex: title, description, path, article No, Product code etc..

And the default field will contain more than one field ex: title, description and path.

So the solr doc will only be returned when the search term satisfied any field from the default field.

1

1 Answers

0
votes

Use three fields - one with the exact string, one with a EdgeNgramTokenizer and one with an NgramTokenizer. You can then use qf=field1^10 field2^5 field3 to score hits in these fields according to how you want to prioritize them between each other.