tags:

views:

175

answers:

1

Good afternoon,

I need to be able to search a Lucene.Net index with a wild card prefix; i.e. now when I search for the word "paint" "autopaint" does not come up, but I need it to.

I have seen mentioned "SetAllowLeadingWildcard" elsewhere in Stack Overflow, but I don't see that property - maybe because I'm using Lucene.NET?

Thanks, Mo

+1  A: 

Which version of Lucene.Net are you using? The SetAllowLeadingWildcard property is on QueryParser in v2.1.

To be able to search for paint and get autopaint back as a result, you would have to search for *paint. Searching for paint would not return autopaint.

Take heed of the note in the comments on the property though:

Note that this can produce very slow queries on big indexes.

adrianbanks