lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wen Gao <samuel.gao...@gmail.com>
Subject [Lucene.Net] Phrase search with Wildcard query
Date Wed, 23 Feb 2011 15:51:25 GMT
Hi,
I'm using Wildcard query to search phrases, but failed to get results. E.g.
I search for "*data man*",however, no result returned although there is a
record of "*data manage*" in my index. I change the "data man" as
"*data*man*" using following code:

"
String s = "*" + s.Replace(" ", "*") + "*";
 WildcardQuery wildquery = new Lucene.Net.Search.WildcardQuery(new
Lucene.Net.Index.Term("name", keyword));
.......
searcher.Search(wildquery);
"

It works if I only search part of phrase without 'space', e.g.  the record
returns when i type "*data*".

Any ideas?



Thanks,

Wen Gao

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message