Optimal lucene query options for doing auto completion
I have开发者_开发问答 lucene acting as my data provider for querying a list of countries to do auto completion from a text box which works fine.
My question is in regards what type of query string should I be sending over to get the most expected return results?
Currently I have something along the lines of
var query = string.Format("*{0}*~0.5", txtCountry.Text)
Would there be any recommended tweaks to that for this usage?
Use the spellcheck contrib instead. The query you're doing is very inefficient, since it uses leading wildcards.
If you really don't want to make an n-gram index, then I guess I don't see any real improvements (except obviously increasing the allowable distance will increase the number of results).
精彩评论