Problem with span_or


(melix) #1

Hi,

I am using the Java query builder API to generate complex queries. One of my generated queries is a span_or query which looks like this :

{
"query" : {
"span_or" : {
"clauses" : [
{
"span_term" : {
"title" : {
"value" : "java",
"boost" : 1.0
}
}
},
{
"span_term" : {
"title" : {
"value" : "javas",
"boost" : 1.0
}
}
}
]
}
},
"fields" : [ "vid", "title" ]
}

However, when the query is executed, I receive this error :

QueryParsingException[[leastic] spanOr must include [clauses]]

I find it awkward as the JSON query is automatically generated and that it does include a "clauses" field. Am I missing something obvious ?

I'm using ES 0.16.2.

Thanks a lot,


(Shay Banon) #2

Can you gist a recreation?

On Wednesday, June 15, 2011 at 12:21 PM, melix wrote:

Hi,

I am using the Java query builder API to generate complex queries. One of my
generated queries is a span_or query which looks like this :

{
"query" : {
"span_or" : {
"clauses" : [
{
"span_term" : {
"title" : {
""value" : "java",
"boost" : 1.0
}
}
}},
{
"span_term" : {
"title" : {
""value" : "javas",
"boost" : 1.0
}
}
}
]
}
},
""fields" : [ "vid", "title" ]
}

However, when the query is executed, I receive this error :

QueryParsingException[[leastic] spanOr must include [clauses]]

I find it awkward as the JSON query is automatically generated and that it
does include a "clauses" field. Am I missing something obvious ?

I'm using ES 0.16.2.

Thanks a lot,

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Problem-with-span-or-tp3066599p3066599.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com (http://Nabble.com).


(melix) #3

Here it is : https://gist.github.com/1026809

Le 15/06/2011 11:35, Shay Banon a écrit :

Can you gist a recreation?

On Wednesday, June 15, 2011 at 12:21 PM, melix wrote:

Hi,

I am using the Java query builder API to generate complex queries.
One of my
generated queries is a span_or query which looks like this :

{
"query" : {
"span_or" : {
"clauses" : [
{
"span_term" : {
"title" : {
""value" : "java",
"boost" : 1.0
}
}
}}},
{
"span_term" : {
"title" : {
"""value" : "javas",
""boost" : 1.0
}
}}
}
]
}
},
""fields" : [ "vid", "title" ]
}

However, when the query is executed, I receive this error :

QueryParsingException[[leastic] spanOr must include [clauses]]

I find it awkward as the JSON query is automatically generated and
that it
does include a "clauses" field. Am I missing something obvious ?

I'm using ES 0.16.2.

Thanks a lot,

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Problem-with-span-or-tp3066599p3066599.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com
http://Nabble.com.


(melix) #4

I just noticed that removing "boost" solves the problem.

Le 15/06/2011 11:47, Cédric Champeau a écrit :

Here it is : https://gist.github.com/1026809

Le 15/06/2011 11:35, Shay Banon a écrit :

Can you gist a recreation?

On Wednesday, June 15, 2011 at 12:21 PM, melix wrote:

Hi,

I am using the Java query builder API to generate complex queries.
One of my
generated queries is a span_or query which looks like this :

{
"query" : {
"span_or" : {
"clauses" : [
{
"span_term" : {
"title" : {
""value" : "java",
"boost" : 1.0
}
}
}}},
{
"span_term" : {
"title" : {
"""value" : "javas",
""boost" : 1.0
}
}}
}
]
}
},
""fields" : [ "vid", "title" ]
}

However, when the query is executed, I receive this error :

QueryParsingException[[leastic] spanOr must include [clauses]]

I find it awkward as the JSON query is automatically generated and
that it
does include a "clauses" field. Am I missing something obvious ?

I'm using ES 0.16.2.

Thanks a lot,

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Problem-with-span-or-tp3066599p3066599.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com
http://Nabble.com.


(Shay Banon) #5

Yea, its a problem with span term query when providing boost. Fixed here: https://github.com/elasticsearch/elasticsearch/issues/1032.

On Wednesday, June 15, 2011 at 1:03 PM, Cédric Champeau wrote:

I just noticed that removing "boost" solves the problem.

Le 15/06/2011 11:47, Cédric Champeau a écrit :

Here it is : https://gist.github.com/1026809

Le 15/06/2011 11:35, Shay Banon a écrit :

Can you gist a recreation?

On Wednesday, June 15, 2011 at 12:21 PM, melix wrote:

Hi,

I am using the Java query builder API to generate complex queries. One of my
generated queries is a span_or query which looks like this :

{
"query" : {
"span_or" : {
"clauses" : [
{
"span_term" : {
"title" : {
""value" : "java",
"boost" : 1.0
}
}
}}},
{
"span_term" : {
"title" : {
"""value" : "javas",
""boost" : 1.0
}
}}
}
]
}
},
""fields" : [ "vid", "title" ]
}

However, when the query is executed, I receive this error :

QueryParsingException[[leastic] spanOr must include [clauses]]

I find it awkward as the JSON query is automatically generated and that it
does include a "clauses" field. Am I missing something obvious ?

I'm using ES 0.16.2.

Thanks a lot,

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Problem-with-span-or-tp3066599p3066599.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com (http://Nabble.com).


(system) #6