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
0
votes
0 answers

Unit test for elastic search response using rest high level client 7.10.2 possible?

I am trying to test my elastic search aggregation. I have a sample json that I want to input and return when i do when(elasticSearch.search(any())).thenReturn(MyOwnReturnResponse). I am not able to see how to return my sample response from a json…
0
votes
1 answer

entity content is too long [658121477] for the configured buffer limit [104857600]

Exception occurred when performing Search operation on Elastic indexes with really large data. Using RestHighLevelClient to perform Search with Http method as RequestOptions.DEFAULT Error Logs: error is : java.io.IOException: entity content is too…
0
votes
0 answers

Connect aws elastic search 7.x with spring boot

I tried connecting aws elasticsearch with spring boot through spring-elasticsearch-data and various other libraries but i get invalid bridge or oss flavor error. Any help in connecting them
0
votes
0 answers

Caused by: java.lang.ClassNotFoundException: org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest

I am migrating from elasticSearch 6.4 to 8.82 and i am trying to run rest high level client on compatibility mode but getting the error. AnyBody has any idea , how can i resolve this error. Getting error on this line: RestHighLevelClient…
0
votes
0 answers

Construct search request from XContentBuilder (Elasticsearch/Opensearch)

I am using the java high level rest client to construct and perform a search on my opensearch index. The query is a knn query with a few postfilter filters. I have built the query using XContentBuilder. I have converted the query to a string and run…
0
votes
0 answers

Open Search BulkProcessor retries config not working

What is the right way to configure the retries of bulk api? I am having some of the batches fail with 429 and 504 which could be retried. Here is how the bulk processor is setup public BulkProcessor createBulkProcessor() { …
user3221430
  • 71
  • 1
  • 6
0
votes
0 answers

How to close HighLevelClient in thread pool

I use the thread pool to batch query the data in the es cluster.It is performant and gives me good parallelization. However I am not able to figure out how to close the client. Actually, I do client.close() in child thread when I finish query. But,…
jg c
  • 27
  • 3
0
votes
1 answer

Trying to use aggregations in java using the ElasticsearchRepository to fetch aggregated data from Elasticsearch. But my aggs are always null

Java = 8 ElasticSearchServer = 7.16.3 My code never returns the value for aggregations , I tried most of the combinations. Below is the code , please see if you can help here @Repository public interface ScPayHkIndexRepository extends…
0
votes
0 answers

No way of implementing page size on restHighLevelClient in java

I have such problem now, I have a requirement to migrate from spring data elasticsearch to restHighLevelClient, and also have to implement pagination, which was pretty easy in Spring data. SearchResponse response = esClient.search(new…
Hayk Mkhitaryan
  • 388
  • 9
  • 26
0
votes
0 answers

ElasticSearch RestHighLevelClient API write cache data in /tmp dir

I used RestHighLevelClient to write data to ElasticSearch and every ThighLevelClient was backed up to the /tmp path Why would RestHighLevelClient backup data to a temporary directory and how to disable data backup? enter image description here
zhao li
  • 1
  • 2
0
votes
1 answer

RestHighLevelClient parameter [include_type_name] with Elastic 8.5.1

iam trying to run spring boot application with RestHighLevelClient 7.17.4 in compatibility mod with elastic 8.5.1 by fallowing guide. When application try to call get, i've got the fallowing error: Elasticsearch exception…
Tomas
  • 35
  • 5
0
votes
2 answers

Calculate exact count of distinct values for combination of 2 fields in Elasticsearch

I have around 40 million records in my elasticsearch index. I want to calculate count of distinct values for combination of 2 fields. Example for given set of documents: [ { "JobId" : 2, "DesigId" : 12 }, { "JobId" : 2, "DesigId" : 4 }, …
0
votes
1 answer

ElasticSearch ReIndex Request not working in synchronous manner using Java Rest High Level Client

I have 2 indexes with names - source_index, destination_index Both indexes have same mappings. I have written following code for making reindex and search requests - @Autowired RestHighLevelClient client; public BulkByScrollResponse…
0
votes
1 answer

ElasticSearch: Group by on the partial field value

My data will look like { {"id": "c1/RESOURCE-Id", ,,,}, {"id": "c2/RESOURCE-Id", ,,,}, {"id": "abc/RESOURCE-Id", ,,,}, {"id": "c1/RESOURCE-Id-2", ,,,} } I want to fetch the unique resource-ids. Result should be RESOURCE-Id RESOURCE-Id-2 So…
Django
  • 103
  • 10
0
votes
1 answer

Unable to delete a document within an Index using Java RestHigh Level Client (Delete By Query)

I am using Elasticsearch 7.10 and want to delete a document inside an index using Delete By Query. I have referenced the official documentation on how to use the library but not sure what exactly i am missing. Any help is appreciated. String…
Tarun Pande
  • 371
  • 1
  • 6
  • 18