Hi, I have an autocomplete that is currently working with an
NGramTokenizer so if I search for "Yo" both "New York" and "Toyota"
are valid results.  However I'm trying to figure out how to best
implement the search so that from a score perspective if the string
matches the beginning of an entire field it ranks first, followed by
the beginning of a term and then in the middle of a term.  For example
if I was searching with "vi" I would want Virginia ahead of West
Virginia ahead of Five.

I think I can do this with three seperate fields, one using a white
space tokenizer and a ngram filter, another using the edge-ngram +
whitespace and another using keyword+edge-ngram, then doing an or on
the 3 fields, so that Virginia would match all 3 and get a higher
score... but this doesn't feel right to me, so I wanted to check for
better options.

Thanks.

Reply via email to