# Current token (VALUE\_NUMBER\_INT) not of boolean type

**URL:** <https://discuss.elastic.co/t/current-token-value-number-int-not-of-boolean-type/210342>\
**Category:** Elasticsearch\
**Created:** [December 3, 2019, 1:04pm UTC](https://discuss.elastic.co/t/current-token-value-number-int-not-of-boolean-type/210342 "2019-12-03T13:04:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyana\_nayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gyana_nayak/32/56498_2.png) [@gyana\_nayak](https://discuss.elastic.co/u/gyana_nayak)\
**Post date:** [December 3, 2019, 1:04pm UTC](https://discuss.elastic.co/t/current-token-value-number-int-not-of-boolean-type/210342/1 "2019-12-03T13:04:10Z")

</div>

Hi All,  
I have written a sample java client which will connect to a remote Ip and collect the data from ElasticSearch but keep on getting below exception .But below code working as expected with localhost. Could someone tell me what is wrong with below code.

```
client = **new** RestHighLevelClient(
RestClient. *builder* ( **new** HttpHost("18.21.51.2xx",9200,"http"))); 
SearchSourceBuilder searchSourceBuilder = **new** SearchSourceBuilder().query(QueryBuilders. *matchQuery* ("orgId", orgId))
.sort("timestamp_match", SortOrder. ***DESC*** ).from(0).size(50).trackTotalHits( **true** ).fetchSource( **true** );
SearchRequest req = **new** SearchRequest("logs");
req.source(searchSourceBuilder);
SearchResponse searchResponse = client.search(req, RequestOptions. ***DEFAULT*** );

```

below is the exception stack trace

```
 org.elasticsearch.client.ResponseException: method [POST], host [http://18.218.51.224:9200], URI [/logs/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&scroll=10m&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 500 Internal Server Error]
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Current token (VALUE_NUMBER_INT) not of boolean type\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4baf3f00; line: 1, column: 366]"}],"type":"json_parse_exception","reason":"Current token (VALUE_NUMBER_INT) not of boolean type\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4baf3f00; line: 1, column: 366]"},"status":500}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:253)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:231)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:205)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1454)

```

logstash version: 7.4.0  
ElasticSearch: 6.8.0

---

<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:** [December 31, 2019, 1:04pm UTC](https://discuss.elastic.co/t/current-token-value-number-int-not-of-boolean-type/210342/2 "2019-12-31T13:04:18Z")

</div>

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