Problem with span_or

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,

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).

Here it is : Throws a parse error when query gets executed · GitHub

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.

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

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

Here it is : Throws a parse error when query gets executed · GitHub

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.

Yea, its a problem with span term query when providing boost. Fixed here: Query DSL: Span Term Query wrongly parses when boost is provided, causing using it in span or to fail · Issue #1032 · elastic/elasticsearch · GitHub.

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 : Throws a parse error when query gets executed · GitHub

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).