On Thu, Dec 24, 2009 at 2:39 AM, Prasanna R <plistma...@gmail.com> wrote:
> On Tue, Dec 22, 2009 at 11:49 PM, Shalin Shekhar Mangar < > shalinman...@gmail.com> wrote: > > > > > > I am curious how an approach that simply uses the wildcard query > > > functionality on an indexed field would work. > > > > > > It works fine as long as the terms are not repeated across documents. > > > > > I do not follow why terms repeating across documents would be an issue. As > long as you can differentiate between multiple matches and rank them > properly it should work right? > > A prefix search would return documents. If a field X being used for auto-complete has the same value in two documents then the user will see the same value being suggested twice. > > > > > > While Solr does not support > > > wildcard queries out of the box currently, it will definitely be > included > > > in > > > the future and I believe the edismax parser already lets you do that. > > > > > > Solr supports prefix queries and there's a reverse wild card filter in > > trunk > > too. > > > > Are you referring to facet prefix queries as prefix queries? I looked at > reversed wild card filter but think that the regular wild card matching as > opposed to leading wild card matching is better suited for an > auto-completion feature. > > No, I'm talking about regular prefix search e.g. field:val* > > > We do auto-complete through prefix searches on shingles. > > > > Just to confirm, do you mean using EdgeNgram filter to produce letter > ngrams > of the tokens in the chosen field? > > No, I'm talking about prefix search on tokens produced by a ShingleFilter. > Assuming the regular wild card query would also work, any thoughts on how > it > compares to the EdgeNGram approach in terms of added indexing cost, > performance, etc.? > > With EdgeNGram, you can do phrase (exact) matches which are faster. But if you have a big corpus of terms then EdgeNGramFilter can produce too many tokens. In some places we are using phrase search on n-gram, in other places (with more terms) we opted for prefix search on shingles. -- Regards, Shalin Shekhar Mangar.