XOR?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XOR?

Fernando Mato Mira
Hello,

  How would one do a XOR query with Lucene?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: XOR?

Yonik Seeley-2
On 8/16/06, Fernando Mato Mira <[hidden email]> wrote:
>   How would one do a XOR query with Lucene?

There's not a specific XOR operation, but you shouldbe able to make it
out of AND, OR, and NOT.

+(A B) -(+A +B)



-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server
Reply | Threaded
Open this post in threaded view
|

Re: XOR?

Erik Hatcher
It is also possible to create a subclass of BooleanQuery which  
overrides the similarity function and returns 0 for coord() when the  
overlap is > 1.

        Erik


On Aug 16, 2006, at 10:14 AM, Yonik Seeley wrote:

> On 8/16/06, Fernando Mato Mira <[hidden email]> wrote:
>>   How would one do a XOR query with Lucene?
>
> There's not a specific XOR operation, but you shouldbe able to make it
> out of AND, OR, and NOT.
>
> +(A B) -(+A +B)
>
>
>
> -Yonik
> http://incubator.apache.org/solr Solr, the open-source Lucene  
> search server