lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: PrefixQuery vs wildcardquery
Date Mon, 28 Sep 2009 21:18:28 GMT
Though in 2.9 this is not much of a concern - the multi term queries  
are smart - if it matches few enough terms it will rewrite to a  
constant score booleanquery - if it matches a lot of terms it will  
rewrite to a constantscore query - using a filter underneath. So  
maxclause issues should no longer be an issue.

- Mark

http://www.lucidimagination.com (mobile)

On Sep 28, 2009, at 3:05 PM, Simon Willnauer <simon.willnauer@googlemail.com 
 > wrote:

> Depending on your usecase you might want to use the PrefixFilter
> instead of PrefixQuery which can be way more efficient than a query.
> With a filter you have the possibility to cache it very easily and you
> are not exposed to issued related to the length of the prefix. If you
> have a very short prefix and in turn lots of terms matching that
> prefix you might run into problems with TooManyBooleanClauses
> expections. The downside is that a filter will not contribute to the
> score of a document.
> Just wanna point you to it if it is an alternative.
>
> simon
>
> On Mon, Sep 28, 2009 at 7:23 PM, entdeveloper
> <cameron.developer@gmail.com> wrote:
>>
>>
>> John Seer wrote:
>>>
>>> Hello,
>>>
>>> Is there any benefit of using one or other for "start with query"?
>>>
>>> Which one is faster?
>>>
>>>
>>> Regards
>>>
>>
>> It seems that you've answered your own question. If you want a  
>> "start with
>> query", this is exactly what a PrefixQuery is for. WildcardQuery  
>> gives you
>> more flexibility, but if you don't need it, then PrefixQuery should  
>> get the
>> job done.
>> --
>> View this message in context: http://www.nabble.com/PrefixQuery-vs-wildcardquery-tp25649045p25649399.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
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