views:

27

answers:

1

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?

+1  A: 

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

Xodarap
I was considering removing the leading wildcard anyway since it operates in somewhat non-obvious way to the user. Using the spell check stuff probably isn't feasible for me currently so I guess I'll have to live with this for the time being.
Chris Marisic