Questions tagged [resthighlevelclient]

Java's High level REST client that wraps an instance of the low level RestClient and allows to build requests and read responses from elastic search

Elastic Search Java's High level REST client that wraps an instance of the low level RestClient and allows to build requests and read responses from elastic search

163 questions
16
votes
3 answers

log JSON queries built through ElasticSearch High Level Java Client for debugging?

I use ElasticSearch High-Level Client Java API in my Spring Boot application. I want to log the queries built using High-Level client API for debugging purposes. My question is what kind of settings required in my application.properties file to turn…
14
votes
4 answers

ElasticsearchStatusException contains unrecognized parameter: [ccs_minimize_roundtrips]]]

I am trying to do a simple search on ElasticSearch server and getting teh following error ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=request [/recordlist1/_search] contains unrecognized parameter:…
meyy
  • 141
  • 1
  • 1
  • 3
5
votes
0 answers

How to search wrapper query with OpenSearchClient in Java SDK?

I'm newbie to opensearch. I'm working on utilizing the OpenSearch's Java SDK. I'know that this contain two java class for client: OpenSearchClient RestHighLevelClient I know that RestHighLevelClient has been deprecated in elasticsearch 7.x, and…
Seungho
  • 71
  • 4
5
votes
2 answers

The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true

My API version is 6.3 and I try to create index. The failure says "The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true" .Here is my code: CreateIndexRequest indexRequest = new…
Zheyou Guo
  • 87
  • 1
  • 1
  • 4
5
votes
2 answers

Put mapping in ElasticSearch by JAVA API

I want to put mapping for a field by JAVA API but failed. Following is detailed information: My data structure is : { "mje-test-execution-id": "464b66ea6c914ddda217659c84a3cb9d", "jvm-free-memory": 315245608, "jvm-total-memory": 361758720, …
Little sun
  • 51
  • 2
4
votes
3 answers

NullPointerException Problem when trying to mock Elastic Search's RestHighLevelClient

I'm facing a NullPointerException during unit testing, when trying to test and mock a RestHighLevelClient inside an ElasticClient class: @Configuration @NoArgsConstructor public class ElasticClient{ @Setter private RestHighLevelClient…
riorio
  • 6,500
  • 7
  • 47
  • 100
3
votes
1 answer

Is RestHighLevelClient keep connections open?

I want to use RestHighLevelClient on different clusters with commands which are not supported by Cross Cluster mechanizem (for example close and open index). My question is if I use more than one instance of RestHighLevelClient for every cluster it…
3
votes
1 answer

How to get only failed documents in the response from Elasticsearch Java High-Level Client 6.8

Is there any way to get only failed documents in the response while bulk request using Elasticsearch Java High-Level REST Client. Currently, ES is sending all the succeed and failed document in the response and we are reprocessing all the failed…
2
votes
1 answer

Elasticsearch Delete By Query does not delete anything with RestHighLevelClient while it deletes with curl

I need to delete all satisfied data with the bool query. Therefore I'm using "_delete_by_request" with term query. My logic is simple. I have an userId and productId. I need to delete all satisfied data with those matching ids. When I debug the code…
2
votes
1 answer

Query on too many scroll contexts

We are using ES version 6.4 and we want to upgrade to 7.4. While testing the up-gradation to do a paginated search using Scroll we are facing the below issue: Trying to create too many scroll contexts. Must be less than or equal to [500]. This…
2
votes
1 answer

Find total amount of disk space used by a Elasticsearch cluster

I am looking for a way to get the total amount of disk space used by a Elasticsearch cluster. I have found suggestions to use the following REST API endpoints to obtain this information among other things: GET /_cat/stats GET /_nodes/stats I was…
Raihan
  • 10,095
  • 5
  • 27
  • 45
2
votes
2 answers

How to get Distinct values using RestHighLevelClient in Elasticsearch?

I saw the post here where you guys gave solution for the link given below. ElasticSearch Java API to get distinct values from the Query Builders Is there any way to achieve distinct emails using org.elasticsearch.client.RestHighLevelClient? Could…
2
votes
1 answer

RestClientBuilder giving IO Exception

I am getting below exception when i am trying to connect to ES intermediately. final CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials(AuthScope.ANY, …
2
votes
2 answers

Elasticsearch sorting - not getting expected results

I have data in elastic field name as "Amit 111", "amit 111", "Amit 222". I am trying to sort it using: searchSourceBuilder.query(query).sort("name.keyword", SortOrder.ASC) It returns result as: "Amit 111", "Amit 222", "amit 111" But I want…
2
votes
0 answers

Getting Timeout Error in ElasticSearch RestHighLevelClient object. How to extend the time limit of 30000 ms?

Here is the error trace : java.io.IOException: listener timeout after waiting for [30000] ms at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:663) at…
aka_code
  • 84
  • 10
1
2 3
10 11