# Is it error Version ？, i cannot use GeoDistanceQueryBuilder

**URL:** <https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684>\
**Category:** Elasticsearch\
**Created:** [May 14, 2018, 7:54am UTC](https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684 "2018-05-14T07:54:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![45fc9af0bd552594c6f8](https://avatars.discourse-cdn.com/v4/letter/4/7cd45c/32.png) [@45fc9af0bd552594c6f8](https://discuss.elastic.co/u/45fc9af0bd552594c6f8)\
**Post date:** [May 14, 2018, 7:54am UTC](https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684/1 "2018-05-14T07:54:29Z")

</div>

I have share my code in github:

[https://github.com/junyi5257/elastic-search](https://github.com/junyi5257/elastic-search)

* * *

Exception: java.lang.IllegalStateException: unexpected byte [0x0a]

```
at org.elasticsearch.common.io.stream.StreamInput.readBoolean(StreamInput.java:412)
at org.elasticsearch.common.io.stream.StreamInput.readBoolean(StreamInput.java:402)
at org.elasticsearch.search.builder.SearchSourceBuilder.<init>(SearchSourceBuilder.java:211)
at org.elasticsearch.common.io.stream.StreamInput.readOptionalWriteable(StreamInput.java:733)
at org.elasticsearch.action.search.SearchRequest.readFrom(SearchRequest.java:421)
at org.elasticsearch.common.io.stream.Streamable.lambda$newWriteableReader$0(Streamable.java:51)
at org.elasticsearch.transport.RequestHandlerRegistry.newRequest(RequestHandlerRegistry.java:56)
at org.elasticsearch.transport.TcpTransport.handleRequest(TcpTransport.java:1508)
at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1382)
at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:64)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:297)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:413)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:545)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at java.lang.Thread.run(Thread.java:748)

```

* * *

my version is ：window7,  
JDK1.8.0\_161,  
ElasticSearch 6.2.2

POM.xml :

 org.springframework.boot spring-boot-starter-parent 2.0.2.RELEASE 

```
<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-elasticsearch</artifactId>
        <version>3.0.5.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>transport</artifactId>
        <version>5.5.0</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

```

* * *

in test file ProductSearchTest.getByHomeTitle() method

---

<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:** [May 14, 2018, 9:11am UTC](https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684/2 "2018-05-14T09:11:27Z")

</div>

the elasticsearch client you are using is on version 5.5, where as elasticsearch is on version 6.2 - have you tried aligning those versions (at least major versions) and retried?

---

<div class="post-metadata">

**Author:** ![45fc9af0bd552594c6f8](https://avatars.discourse-cdn.com/v4/letter/4/7cd45c/32.png) [@45fc9af0bd552594c6f8](https://discuss.elastic.co/u/45fc9af0bd552594c6f8)\
**Post date:** [May 15, 2018, 2:47am UTC](https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684/3 "2018-05-15T02:47:15Z")

</div>

thank you very much ，it‘s ok on elasticsearch 5.5 ,  
but I need run it on version 6.2 ，  
I try using  
  
org.springframework.boot  
spring-boot-starter-parent  
2.1.0.BUILD-SNAPSHOT

but，I found it is only support  
\<elasticsearch.version\>5.6.9\</elasticsearch.version\>

maybe I need to wait someday that spring-boot support 6.0+，

all in all, thank u Very much！

---

<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:** [June 12, 2018, 2:47am UTC](https://discuss.elastic.co/t/is-it-error-version-i-cannot-use-geodistancequerybuilder/131684/4 "2018-06-12T02:47:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
