query (a AND b) OR c does not return c

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

query (a AND b) OR c does not return c

Colin Surprenant
Hi,

It seem queries of the type (a AND b) OR c do not find the results
from c, it only find results for (a AND b).

I am using ES 0.6.0 with default configuration.

Here's how to reproduce:

create 2 documents:

curl -XPUT 'http://localhost:9200/test1/test1/1' -d '
{
    "text" : "the quick brow fox aaaaaa bbbbbb"
}
'

curl -XPUT 'http://localhost:9200/test1/test1/2' -d '
{
    "text" : "the quick brow fox cccccc"
}
'
run the search:


curl -XGET 'http://localhost:9200/test1/test1/_search?q=(aaaaaa%20AND%20bbbbbb)%20OR%20cccccc'

result:

{"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"hits":[{"_index":"test1","_type":"test1","_id":"1",
"_source" :
{
    "text" : "the quick brow fox aaaaaa bbbbbb"
}

the document with cccccc should have been found.

Is there something I am missing?

Thanks,
Colin
Reply | Threaded
Open this post in threaded view
|

Re: query (a AND b) OR c does not return c

kimchy
Administrator
Hi,

  Its a bug in elasticseach, I have committed a fix and will be part of 0.7. Thanks for working on an example!, and thanks for #danielg from IRC.

cheers,
shay.banon

On Fri, May 14, 2010 at 5:37 AM, Colin Surprenant <[hidden email]> wrote:
Hi,

It seem queries of the type (a AND b) OR c do not find the results
from c, it only find results for (a AND b).

I am using ES 0.6.0 with default configuration.

Here's how to reproduce:

create 2 documents:

curl -XPUT 'http://localhost:9200/test1/test1/1' -d '
{
   "text" : "the quick brow fox aaaaaa bbbbbb"
}
'

curl -XPUT 'http://localhost:9200/test1/test1/2' -d '
{
   "text" : "the quick brow fox cccccc"
}
'
run the search:


curl -XGET 'http://localhost:9200/test1/test1/_search?q=(aaaaaa%20AND%20bbbbbb)%20OR%20cccccc'

result:

{"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"hits":[{"_index":"test1","_type":"test1","_id":"1",
"_source" :
{
   "text" : "the quick brow fox aaaaaa bbbbbb"
}

the document with cccccc should have been found.

Is there something I am missing?

Thanks,
Colin

Reply | Threaded
Open this post in threaded view
|

Re: query (a AND b) OR c does not return c

Colin Surprenant
Good stuff. Just built master and I confirm the fix works.  Thanks!

Colin

On Fri, May 14, 2010 at 1:17 AM, Shay Banon
<[hidden email]> wrote:

> Hi,
>   Its a bug in elasticseach, I have committed a fix and will be part of 0.7.
> Thanks for working on an example!, and thanks for #danielg from IRC.
> cheers,
> shay.banon
>
> On Fri, May 14, 2010 at 5:37 AM, Colin Surprenant
> <[hidden email]> wrote:
>>
>> Hi,
>>
>> It seem queries of the type (a AND b) OR c do not find the results
>> from c, it only find results for (a AND b).
>>
>> I am using ES 0.6.0 with default configuration.
>>
>> Here's how to reproduce:
>>
>> create 2 documents:
>>
>> curl -XPUT 'http://localhost:9200/test1/test1/1' -d '
>> {
>>    "text" : "the quick brow fox aaaaaa bbbbbb"
>> }
>> '
>>
>> curl -XPUT 'http://localhost:9200/test1/test1/2' -d '
>> {
>>    "text" : "the quick brow fox cccccc"
>> }
>> '
>> run the search:
>>
>>
>> curl -XGET
>> 'http://localhost:9200/test1/test1/_search?q=(aaaaaa%20AND%20bbbbbb)%20OR%20cccccc'
>>
>> result:
>>
>>
>> {"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"hits":[{"_index":"test1","_type":"test1","_id":"1",
>> "_source" :
>> {
>>    "text" : "the quick brow fox aaaaaa bbbbbb"
>> }
>>
>> the document with cccccc should have been found.
>>
>> Is there something I am missing?
>>
>> Thanks,
>> Colin
>
>