Lucene.Net PrefixQuery
- by Sole
Hi, i´m development a suggest box for my site search service. I has to search fields like these:
Visual Basic Enterprise Edition
Visual C++
Visual J++
My code is:
Directory dir = Lucene.Net.Store.FSDirectory.GetDirectory("Index", false);
IndexSearcher searcher = new Lucene.Net.Search.IndexSearcher( dir,true);
Term term = new Term("nombreAnalizado", _que);
PrefixQuery query = new PrefixQuery(term);
TopDocs topDocs = searcher.Search(query, 10000);
This code works well in this case:
"Enterprise" will match "Visual Basic Enterprise Edition"
But "Enterprise E" doesn´t match anything.
I removed white spaces at indexing time and when the user is searching.
Thanks.