Not registered for this query

Hi folks

I'm pretty new to elasticsearch and I'm using the Perl libraries [thanks
for those CG!] to build queries. I'm dumping the output of the built
queries before using them. In the case below the query gets built but then
produces:

nested: QueryParsingException[[follow] No query registered for [query]]; }]

I'm guessing that there's maybe too much nesting and parser believes that
I'm using a named query? Anyway, any commentary from someone with more
experience would be very helpful. Best regards Hugh Barnard

"query" : {
"query" : {
"filtered" : {
"filter" : {
"and" : [
{
"not" : {
"filter" : {
"term" : {
"userLogin" : "test1"
}
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km",
"end_point" : {
"lat" : "51.694452787735266",
"lon" : "-0.18577472083490099"
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"start_point" : {
"lat" : "51.512775015858224",
"lon" : "-0.13084308021210087"
},
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km"
}
}
]
},
"query" : {
"bool" : {
"must" : [
{
"match" : {
"status" : "active"
}
},
{
"match" : {
"requesttype" : "offer"
}
},
{
"range" : {
"starttime" : {
"gte" : 1358555400
}
}
},
{
"range" : {
"endtime" : {
"lte" : 1358555400,
"gte" : 1358692302
}
}
}
]
}
}
}
}
}
}

--

Too many "queries" at the top. It should be:

"query":{
"filtered": {
....

On Sunday, January 20, 2013 10:11:41 AM UTC-5, Hugh Barnard wrote:

Hi folks

I'm pretty new to elasticsearch and I'm using the Perl libraries [thanks
for those CG!] to build queries. I'm dumping the output of the built
queries before using them. In the case below the query gets built but then
produces:

nested: QueryParsingException[[follow] No query registered for [query]];
}]

I'm guessing that there's maybe too much nesting and parser believes that
I'm using a named query? Anyway, any commentary from someone with more
experience would be very helpful. Best regards Hugh Barnard

"query" : {
"query" : {
"filtered" : {
"filter" : {
"and" : [
{
"not" : {
"filter" : {
"term" : {
"userLogin" : "test1"
}
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km",
"end_point" : {
"lat" : "51.694452787735266",
"lon" : "-0.18577472083490099"
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"start_point" : {
"lat" : "51.512775015858224",
"lon" : "-0.13084308021210087"
},
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km"
}
}
]
},
"query" : {
"bool" : {
"must" : [
{
"match" : {
"status" : "active"
}
},
{
"match" : {
"requesttype" : "offer"
}
},
{
"range" : {
"starttime" : {
"gte" : 1358555400
}
}
},
{
"range" : {
"endtime" : {
"lte" : 1358555400,
"gte" : 1358692302
}
}
}
]
}
}
}
}
}
}

--

Hi Igor
Thanks very much, now I have to work out what went wrong in the query
builder piece! Best regards Hugh

On 21 January 2013 20:09, Igor Motov imotov@gmail.com wrote:

Too many "queries" at the top. It should be:

"query":{
"filtered": {
....

On Sunday, January 20, 2013 10:11:41 AM UTC-5, Hugh Barnard wrote:

Hi folks

I'm pretty new to elasticsearch and I'm using the Perl libraries [thanks
for those CG!] to build queries. I'm dumping the output of the built
queries before using them. In the case below the query gets built but then
produces:

nested: QueryParsingException[[follow] No query registered for [query]];
}]

I'm guessing that there's maybe too much nesting and parser believes that
I'm using a named query? Anyway, any commentary from someone with more
experience would be very helpful. Best regards Hugh Barnard

"query" : {
"query" : {
"filtered" : {
"filter" : {
"and" : [
{
"not" : {
"filter" : {
"term" : {
"userLogin" : "test1"
}
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km",
"end_point" : {
"lat" : "51.694452787735266",
"lon" : "-0.18577472083490099"
}
}
},
{
"geo_distance_range" : {
"to" : "5km",
"start_point" : {
"lat" : "51.512775015858224",
"lon" : "-0.13084308021210087"
},
"normalize" : "1",
"include_lower" : "1",
"include_upper" : "1",
"from" : "5km"
}
}
]
},
"query" : {
"bool" : {
"must" : [
{
"match" : {
"status" : "active"
}
},
{
"match" : {
"requesttype" : "offer"
}
},
{
"range" : {
"starttime" : {
"gte" : 1358555400
}
}
},
{
"range" : {
"endtime" : {
"lte" : 1358555400,
"gte" : 1358692302
}
}
}
]
}
}
}
}
}
}

--

--
http://www.hughbarnard.org
http://www.twitter.com/hughbarnard
http://www.big-wave-heuristics.com/
http://www.hackney-environment-network.org.uk/

--