开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜