You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Guangwei Yuan <gu...@gmail.com> on 2009/11/06 22:48:26 UTC

Disable coord

Hi,

I want to disable coord for certain queries.  For example, if I pass a URL
parameter like "disableCoord" to Solr, the BooleanQuery generated will have
coord disabled.  If it's not currently supported, what would be a good way
to implement it?

Thanks,
Guangwei

Re: Disable coord

Posted by Chris Hostetter <ho...@fucit.org>.
: Thanks for your reply.  Nested boolean queries is a valid concern.  I also
: realized that isCoordDisabled needs to be considered in
: BooleanQuery.hashCode so that a query with coord=false will have a different
: cache key in Solr.

Hmmm... you're right, BooleanQuery.hashCode doesn't consider disableCoord.  
that's a nasty bug...

	https://issues.apache.org/jira/browse/LUCENE-2092


-Hoss


Re: Disable coord

Posted by Guangwei Yuan <gu...@gmail.com>.
Thanks for your reply.  Nested boolean queries is a valid concern.  I also
realized that isCoordDisabled needs to be considered in
BooleanQuery.hashCode so that a query with coord=false will have a different
cache key in Solr.

On Thu, Nov 12, 2009 at 12:12 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : I want to disable coord for certain queries.  For example, if I pass a
> URL
> : parameter like "disableCoord" to Solr, the BooleanQuery generated will
> have
> : coord disabled.  If it's not currently supported, what would be a good
> way
> : to implement it?
>
> in order to have something like this on a per query basis it needs to be
> handled by the query parsers.  the Lucene QueryParser doesn't provide any
> syntax markup to do this, so you would have to add your own -- you could
> subclass the LuceneQParserPlugin and just have it *always* ignore the cord
> if some query param coord=false was set, but you'd have to be careful
> about wether that's really what you want in a deeply nested set of boolean
> queries -- ie:   (A +B -C +(D E F G H) ((X Y Z) (L M (N O P)))) ... what
> if you only want to disable the coord on the (X Y Z) boolean query?
>
> :
> : Thanks,
> : Guangwei
> :
>
>
>
> -Hoss
>
>

Re: Disable coord

Posted by Chris Hostetter <ho...@fucit.org>.
: I want to disable coord for certain queries.  For example, if I pass a URL
: parameter like "disableCoord" to Solr, the BooleanQuery generated will have
: coord disabled.  If it's not currently supported, what would be a good way
: to implement it?

in order to have something like this on a per query basis it needs to be 
handled by the query parsers.  the Lucene QueryParser doesn't provide any 
syntax markup to do this, so you would have to add your own -- you could 
subclass the LuceneQParserPlugin and just have it *always* ignore the cord 
if some query param coord=false was set, but you'd have to be careful 
about wether that's really what you want in a deeply nested set of boolean 
queries -- ie:   (A +B -C +(D E F G H) ((X Y Z) (L M (N O P)))) ... what 
if you only want to disable the coord on the (X Y Z) boolean query?

: 
: Thanks,
: Guangwei
: 



-Hoss