You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Nalin Mittal <nm...@dag.com> on 2004/06/16 02:17:42 UTC

Wildcard Prefix

Does anyone have some sample code that implements the Wildcard Prefix
functionality so that a search like ‘*ucene’ could be executed?
Any help would be much appreciated. 
 
Thanks.

Nalin Mittal
Senior Engineer
Data Advantage Group, Inc.






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


Re: Wildcard Prefix

Posted by Brian Goetz <br...@quiotix.com>.
> WildcardQuery (via the API, not QueryParser) allows '*ucene' syntax.
>
> Why doesn't QueryParser allow this?  Because it is a very inefficient 
> and potentially performance killing type of query.  Lucene must 
> navigate *every* term in the index in order to find what matches. 


More specifically, QueryParser is often used in applications where the 
query string will have been typed into a web form by a user.  You don't 
want a naive user (or a typo) to take down your application.)  Queries 
constructed by by the query API are less likely to be "accidental."



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


Re: Wildcard Prefix

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 15, 2004, at 8:17 PM, Nalin Mittal wrote:
> Does anyone have some sample code that implements the Wildcard Prefix
> functionality so that a search like ‘*ucene’ could be executed?

WildcardQuery (via the API, not QueryParser) allows '*ucene' syntax.

Why doesn't QueryParser allow this?  Because it is a very inefficient 
and potentially performance killing type of query.  Lucene must 
navigate *every* term in the index in order to find what matches.

	Erik



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