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


(Colin Surprenant) #1

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


(Shay Banon) #2

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 <
colin.surprenant@gmail.com> 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


(Colin Surprenant) #3

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

Colin

On Fri, May 14, 2010 at 1:17 AM, Shay Banon
shay.banon@elasticsearch.com 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
colin.surprenant@gmail.com 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


(system) #4