# Exception with geoDistanceFilter

**URL:** <https://discuss.elastic.co/t/exception-with-geodistancefilter/15594>\
**Category:** Elasticsearch\
**Created:** [February 4, 2014, 4:40pm UTC](https://discuss.elastic.co/t/exception-with-geodistancefilter/15594 "2014-02-04T16:40:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oren\_Kagan](https://avatars.discourse-cdn.com/v4/letter/o/e95f7d/32.png) [@Oren\_Kagan](https://discuss.elastic.co/u/Oren_Kagan)\
**Post date:** [February 4, 2014, 4:40pm UTC](https://discuss.elastic.co/t/exception-with-geodistancefilter/15594/1 "2014-02-04T16:40:15Z")

</div>

Hello there,  
I tried to solve this for a while with no success and I'm asking for help  
with using the geoDistanceFilter (and this problem happens both on Java as  
well as on the REST api).  
When I'm using geoDistanceFilter, such as here:  
FilterBuilder locationFilter = FilterBuilders.geoDistanceFilter("location")  
.point(-71.12163, 42.342587)  
.distance(1000, DistanceUnit.METERS);  
I'm getting the exception below (Note that if I replace my locationFilter  
with FilterBuilders.matchAllFilter() the search works OK with no  
exception).  
Do you have any idea why I am getting this and how to make it work?  
Thanks,  
OK

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
execute phase [query], all shards failed; shardFailures  
{[QXuVaxICQWWe8hf6QV3eDw][stores][4]: RemoteTransportException[[Andrew  
Gervais][inet[/67.168.58.25:9302]][search/phase/query]]; nested:  
SearchParseException[[stores][4]: from[-1],size[100]: Parse Failure [Failed  
to parse source  
[{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
nested: QueryParsingException[[stores] failed to find geo\_point field  
[location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][2]:  
RemoteTransportException[[Andrew  
Gervais][inet[/68.169.58.25:9302]][search/phase/query]]; nested:  
SearchParseException[[stores][2]: from[-1],size[100]: Parse Failure [Failed  
to parse source  
[{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
nested: QueryParsingException[[stores] failed to find geo\_point field  
[location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][3]:  
RemoteTransportException[[Andrew  
Gervais][inet[/68.169.58.25:9302]][search/phase/query]]; nested:  
SearchParseException[[stores][3]: from[-1],size[100]: Parse Failure [Failed  
to parse source  
[{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
nested: QueryParsingException[[stores] failed to find geo\_point field  
[location]]; }{[hlytGdVrTi6zoYt2K\_9ATw][stores][1]:  
SearchParseException[[stores][1]: from[-1],size[100]: Parse Failure [Failed  
to parse source  
[{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
nested: QueryParsingException[[stores] failed to find geo\_point field  
[location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][0]:  
RemoteTransportException[[Andrew  
Gervais][inet[/68.169.58.25:9302]][search/phase/query]]; nested:  
SearchParseException[[stores][0]: from[-1],size[100]: Parse Failure [Failed  
to parse source  
[{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
nested: QueryParsingException[[stores] failed to find geo\_point field  
[location]]; }  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:272)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$4.handleException(SearchServiceTransportAction.java:222)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:181)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:171)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:123)  
at  
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)  
at  
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)  
at  
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)  
at  
org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)  
at  
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
at  
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at  
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:744)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f6f9c1c8-288f-4451-88e0-c309a190a0b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f6f9c1c8-288f-4451-88e0-c309a190a0b5%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 6, 2014, 10:18am UTC](https://discuss.elastic.co/t/exception-with-geodistancefilter/15594/2 "2014-02-06T10:18:06Z")

</div>

Hey,

check the exception at the end of your response and its message, it is  
basically telling you, that you need to define a geo point for the location  
field in your mapping, if you want to use the geo distance filter. Can you  
check your mapping, if you maybe missed that?

--Alex

On Tue, Feb 4, 2014 at 5:40 PM, Oren Kagan [okagan99@gmail.com](mailto:okagan99@gmail.com) wrote:

> Hello there,  
> I tried to solve this for a while with no success and I'm asking for help  
> with using the geoDistanceFilter (and this problem happens both on Java  
> as well as on the REST api).  
> When I'm using geoDistanceFilter, such as here:  
> FilterBuilder locationFilter = FilterBuilders.geoDistanceFilter("location")  
> .point(-71.12163, 42.342587)  
> .distance(1000, DistanceUnit.METERS);  
> I'm getting the exception below (Note that if I replace my locationFilter  
> with FilterBuilders.matchAllFilter() the search works OK with no  
> exception).  
> Do you have any idea why I am getting this and how to make it work?  
> Thanks,  
> OK
> 
> org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
> execute phase [query], all shards failed; shardFailures  
> {[QXuVaxICQWWe8hf6QV3eDw][stores][4]: RemoteTransportException[[Andrew  
> Gervais][inet[/67.168.58.25:9302]][search/phase/query]]; nested:  
> SearchParseException[[stores][4]: from[-1],size[100]: Parse Failure  
> [Failed to parse source  
> [{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
> nested: QueryParsingException[[stores] failed to find geo\_point field  
> [location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][2]:  
> RemoteTransportException[[Andrew Gervais][inet[/68.169.58.25:9302]][search/phase/query]];  
> nested: SearchParseException[[stores][2]: from[-1],size[100]: Parse Failure  
> [Failed to parse source  
> [{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
> nested: QueryParsingException[[stores] failed to find geo\_point field  
> [location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][3]:  
> RemoteTransportException[[Andrew Gervais][inet[/68.169.58.25:9302]][search/phase/query]];  
> nested: SearchParseException[[stores][3]: from[-1],size[100]: Parse Failure  
> [Failed to parse source  
> [{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
> nested: QueryParsingException[[stores] failed to find geo\_point field  
> [location]]; }{[hlytGdVrTi6zoYt2K\_9ATw][stores][1]:  
> SearchParseException[[stores][1]: from[-1],size[100]: Parse Failure [Failed  
> to parse source  
> [{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
> nested: QueryParsingException[[stores] failed to find geo\_point field  
> [location]]; }{[QXuVaxICQWWe8hf6QV3eDw][stores][0]:  
> RemoteTransportException[[Andrew Gervais][inet[/68.169.58.25:9302]][search/phase/query]];  
> nested: SearchParseException[[stores][0]: from[-1],size[100]: Parse Failure  
> [Failed to parse source  
> [{"size":100,"query":{"filtered":{"query":{"match\_all":{}},"filter":{"geo\_distance":{"location":[42.342587,-71.12163],"distance":"1000.0m"}}}}}]]];  
> nested: QueryParsingException[[stores] failed to find geo\_point field  
> [location]]; }  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:272)  
> at  
> org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)  
> at  
> org.elasticsearch.search.action.SearchServiceTransportAction$4.handleException(SearchServiceTransportAction.java:222)  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:181)  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:171)  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:123)  
> at  
> org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
> at  
> org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)  
> at  
> org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)  
> at  
> org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)  
> at  
> org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)  
> at  
> org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
> at  
> org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)  
> at  
> org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
> at  
> org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
> at  
> org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:744)
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/f6f9c1c8-288f-4451-88e0-c309a190a0b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f6f9c1c8-288f-4451-88e0-c309a190a0b5%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_s0rNzZ0uzkn-rjKRDXD9kJx1iAqOaKQYt5xydHGWOdw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_s0rNzZ0uzkn-rjKRDXD9kJx1iAqOaKQYt5xydHGWOdw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:52am UTC](https://discuss.elastic.co/t/exception-with-geodistancefilter/15594/3 "2017-07-06T01:52:05Z")

</div>


