Henry
Henry

Reputation: 384

solr exact match and indicator?

My documents have 5 fields, how can I config solr so that: 1)exact matches are on the top 2)indicator that there is exact match on the document additionally, is it possible to know which field the exact match happens?

Thanks.

Upvotes: 0

Views: 371

Answers (1)

Jayendra
Jayendra

Reputation: 52809

If you want to boost documents with exact higher than the analyzed ones -

  • Create one fields one without any analysis (maybe just lower case and others) to hold original value
  • Create other field with all the analysis applied (lowercase, ascii, synonyms, stemmer ...)
  • Add a boost for the Exact match field.
  • If the match is exact, the analysed field would also have a match which in case will boost the documents with exact match higher.

For the Indicator, you probably have to enable highlighting and check if the highlight it returned for the exact field match.

Upvotes: 1

Related Questions