lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Deluca <decl...@gmail.com>
Subject Combine WildcardQuerys
Date Tue, 22 Dec 2009 12:51:27 GMT
Hello,

We currenty have implemeted a search for person by surname and forename with
lucene 2.4.1.
If both seach fields are filled, then we combine the WildcardQuerys in a
BooleanQuery.
*
BooleanQuery theQuery = new BooleanQuery();
theQuery.add(new WildcardQuery(new Term("surname", "foo")), Occur.MUST);
theQuery.add(new WildcardQuery(new Term("forename", "b*")), Occur.MUST);*
*LuceneSearcherFactory theSearcherFactory =
LuceneSearcherFactory.getInstance();
Searcher theSearcher = theSearcherFactory.getSearcher();
theRewritten = theSearcher.rewrite(theQuery);

*In the database there is exactly one Person with surname "foo". When i
comment the second term (forename) search works fine.
If i run search including term "forename" "b*", the Searcher throws an
TooManyClauses Exception white trying to rewrite the Query.
While rewriting the searcher seems to find too many possibilities for
forenames beginning with "b".

How do i have to combine the terms so that lucene search works properly?

Thanks,
Claudio

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