views:

606

answers:

1

Hi, I have a lucene index I am trying to do a wildcard search. In index i have a character like '234Test2343' I am trying to do the search like %Test%..

My lucene syntax looks like

string catalogNumber="test";
Term searchTerm = new Term("FIELD", "*"+catalogNumber+"*");
Query query = new TermQuery(searchTerm);

I don't get the results back. Any thoughts?

Thanks

+1  A: 

You can use a WildCardQuery. A TermQuery looks for the literal asterisk, rather than a wild card. Please note that a WildCardQuery's performance is usually very slow, probably more so when using two wild cards as you do.

Yuval F
looks like it gives me back top 100 results? is there a way to get more than 100 results?
bkhanal
Could you please add the search commands to your code snippet above?This way I may be able to answer the number of hits question.
Yuval F