You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Patricio Galeas <ga...@prometa.de> on 2009/09/10 10:40:44 UTC

TooManyClauses by wildcard queries

Hi all,

I get the TooManyClauses exception by some wildcard queries like :
(a) de*
(b) country AND de*
(c) ma?s* AND de*

I'm not sure how to apply the solution proposed in LuceneFAQ for the 
case of WildcardQueries like the examples above.

Can you confirm if it is the right procedure?

1. Override QueryParser.getWildcardQuery() to return a ConstantScoreQuery.
2. Break up the query to identify the wildcard query part.
3. Create a custom Filter for the wildcard query
4. Create the final query using the custom filter.

If the item 2. is right, can you suggest me an optimal way to do that?

Thank you
Patricio




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


Re: TooManyClauses by wildcard queries

Posted by Patricio Galeas <ga...@prometa.de>.
Hi Uwe

But if  I don't use Lucene 2.9, is this procedure (items 1-4) the right 
way to avoid the TooManyClauses exception? or is there a more efficients 
procedure to do that?
Thanks
Patricio

Uwe Schindler schrieb:
> Or use Lucene 2.9, it automatically uses constant score mode in wild card
> queries, if needed.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>   
>> -----Original Message-----
>> From: Patricio Galeas [mailto:galeas@prometa.de]
>> Sent: Thursday, September 10, 2009 10:41 AM
>> To: java-user@lucene.apache.org
>> Subject: TooManyClauses by wildcard queries
>>
>> Hi all,
>>
>> I get the TooManyClauses exception by some wildcard queries like :
>> (a) de*
>> (b) country AND de*
>> (c) ma?s* AND de*
>>
>> I'm not sure how to apply the solution proposed in LuceneFAQ for the
>> case of WildcardQueries like the examples above.
>>
>> Can you confirm if it is the right procedure?
>>
>> 1. Override QueryParser.getWildcardQuery() to return a ConstantScoreQuery.
>> 2. Break up the query to identify the wildcard query part.
>> 3. Create a custom Filter for the wildcard query
>> 4. Create the final query using the custom filter.
>>
>> If the item 2. is right, can you suggest me an optimal way to do that?
>>
>> Thank you
>> Patricio
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>   


-- 
P a t r i c i o   G a l e a s
ProMeta Team
--------------------------------------
I n f o t r a X  G m b H

Fon  +49 (0)271 30 30 888
Fax  +49 (0)271 74124-77
Mob  +49 (0)177 2962611

Adresse:
Friedrichstraße 81
D-57072 Siegen 

Geschäftsführerin
Dipl.-Wi.-Inf. Stephanie Sarach 

Handelsregister
HRB 8877 Amtsgericht Siegen 

http://www.prometa.de
http://www.infotrax.de
--------------------------------------


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


RE: TooManyClauses by wildcard queries

Posted by Uwe Schindler <uw...@thetaphi.de>.
Or use Lucene 2.9, it automatically uses constant score mode in wild card
queries, if needed.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Patricio Galeas [mailto:galeas@prometa.de]
> Sent: Thursday, September 10, 2009 10:41 AM
> To: java-user@lucene.apache.org
> Subject: TooManyClauses by wildcard queries
> 
> Hi all,
> 
> I get the TooManyClauses exception by some wildcard queries like :
> (a) de*
> (b) country AND de*
> (c) ma?s* AND de*
> 
> I'm not sure how to apply the solution proposed in LuceneFAQ for the
> case of WildcardQueries like the examples above.
> 
> Can you confirm if it is the right procedure?
> 
> 1. Override QueryParser.getWildcardQuery() to return a ConstantScoreQuery.
> 2. Break up the query to identify the wildcard query part.
> 3. Create a custom Filter for the wildcard query
> 4. Create the final query using the custom filter.
> 
> If the item 2. is right, can you suggest me an optimal way to do that?
> 
> Thank you
> Patricio
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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