lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <markharw...@yahoo.co.uk>
Subject Re: Wildcard vs Term query
Date Wed, 26 Sep 2007 09:21:53 GMT
Are you using the out of the box Lucene QueryParser?  It will automatically detect wildcard
queries by the presence of * or ? chars.
If the user input does not contain these characters a plain TermQuery is used.

BooleanQuery.setMaxClauseCount can be used to control the upper limit on terms produced by
Wildcard/Fuzzy Queries.
If this limit is exceeded (e.g when searching for something like "a*" ) then an exception
is thrown.

Cheers
Mark
----- Original Message ----
From: John Byrne <john.byrne@propylon.com>
To: java-user@lucene.apache.org
Sent: Wednesday, 26 September, 2007 9:48:17 AM
Subject: Wildcard vs Term query

Hi,

I'm working my way through the Lucene In Action book, and there is one 
thing I need explained that I didn't find there;

While wildcard queries are potentially slower than ordinary term 
queries, are they slower even if theyt don't contain a wildcard? 
Significantly slower?

The reason I ask is that if we assume we are going to allow wildcards in 
a search engine, but we want to optimize, to take advantage of  when 
they are NOT used, do we have to check for the presence of "*" or "?" in 
the term, and create the most appropriate query, or can I assume that 
when a wildcard is not present, the WildcardQuery will be as fast (or 
almost as fast) a a plain term query?

Thanks in advance!
John B.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org






      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message