# Not registered for this query

**URL:** <https://discuss.elastic.co/t/not-registered-for-this-query/10427>\
**Category:** Elasticsearch\
**Created:** [January 20, 2013, 3:11pm UTC](https://discuss.elastic.co/t/not-registered-for-this-query/10427 "2013-01-20T15:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugh\_Barnard](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@Hugh\_Barnard](https://discuss.elastic.co/u/Hugh_Barnard)\
**Post date:** [January 20, 2013, 3:11pm UTC](https://discuss.elastic.co/t/not-registered-for-this-query/10427/1 "2013-01-20T15:11:41Z")

</div>

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  
}  
}  
}  
]  
}  
}  
}  
}  
}  
}

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [January 21, 2013, 8:09pm UTC](https://discuss.elastic.co/t/not-registered-for-this-query/10427/2 "2013-01-21T20:09:12Z")

</div>

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  
> }  
> }  
> }  
> ]  
> }  
> }  
> }  
> }  
> }  
> }

--

---

<div class="post-metadata">

**Author:** ![Hugh\_Barnard](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@Hugh\_Barnard](https://discuss.elastic.co/u/Hugh_Barnard)\
**Post date:** [January 22, 2013, 5:57am UTC](https://discuss.elastic.co/t/not-registered-for-this-query/10427/3 "2013-01-22T05:57:37Z")

</div>

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](mailto: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.hughbarnard.org)  
[http://www.twitter.com/hughbarnard](http://www.twitter.com/hughbarnard)  
[http://www.big-wave-heuristics.com/](http://www.big-wave-heuristics.com/)  
[http://www.hackney-environment-network.org.uk/](http://www.hackney-environment-network.org.uk/)

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:55am UTC](https://discuss.elastic.co/t/not-registered-for-this-query/10427/4 "2017-07-06T02:55:19Z")

</div>

Closed on July 6, 2017, 2:55am UTC


