Which analyzers should be used for indexing and for searching when I want an exact match to rank higher then a "partial" match? Possibly set up custom scoring in a Similarity
class?
For example, when my index consist of car parts
, car
, and car shop
(indexed with StandardAnalyzer
on lucene 3.5), a query for "car"
results in:
- car parts
- car
- car shop
(basically returned in the order in which they were added, since they all get the same score).
What I would like to see is car
ranked first, then the other results (doesn't really matter which order, I assume the analyzer can influence that).