Questions tagged [elasticsearch-high-level-restclient]

Tag used when doing elastic query using High Level Rest Client

71 questions
1
vote
0 answers

Mockito Test for Elastic Java api client

I have tried to mock the response for the below method, but it's not working. Not able to mock the search.hits().hits() method. Any idea how to do that? SearchResponse search = client.search(s -> s .index("products") .query(q -> q …
1
vote
1 answer

Reindex selected _source fields using Rest high level client in java

I want to re_index only selected fields from my document in elasticsearch using Rest High level client. I know the elasticsearch query to achieve that but I don't know it's equivalent query using rest client. Following is the elasticsearch query…
1
vote
0 answers

ES7 Migration :: From Transport Client to API client

I know that there exists documentation for migrating ES7 clients from [TransportClient to HighLevelRestClient] and [HighLevelRestClient to API client]. But I want to check if it is possible to directly migrate from [TransportClient to APIClient] Is…
1
vote
2 answers

Migrating to Elasticsearch 8.x from ES 7.17.5

We are using Elasticsearch 7.17.5 which is used by a Java 8 application. We are planning to upgrade to Elasticsearch 8.x. Since High-level Rest Client is now deprecated I am unable to resolve dependencies in order to use the HLRC existing code with…
1
vote
1 answer

Sorting in elastic search using new java api

I am using the latest java API for communication with the elastic search server. I require to search data in some sorted order. SortOptions sort = new SortOptions.Builder().field(f ->…
1
vote
1 answer

Change timeout in run time - Elasticsearch RestHighLevelClient

Below is the Rest client initialization. RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(httpHost).setRequestConfigCallback( requestConfigBuilder -> requestConfigBuilder .setConnectTimeout(30000) …
1
vote
1 answer

How to get Node status HighLevelRESTClient ElasticSearch

I am using the Java HighLevelRestClient to connect to my ElasticSearch.I was working on a task to get the health status of each nodes. Tried with : private string getHighLevelClientInfo(){ try{ ClusterHealthResponse…
1
vote
3 answers

Bootstrap method initialization exception - Elasticsearch 7.8.0

Using java-high-level-rest client when we call getMapping for index or create index functions below errors get generated every time. almost for all the index related calls are generating this exception. bootstrap method initialization exception at…
user426082
  • 11
  • 1
  • 2
1
vote
1 answer

Acessing elasctiDB behind reverse proxy

I have an RestHighLevelClient to connect to a remote elasticDB behind a reversed proxy which strips the ssl. val restClientBuilder: RestClientBuilder = RestClient .builder(HttpHost(hostname, port, scheme)) …
1
vote
3 answers

Elastic Search SSL Certificate Expiry

I'm new to Elastic search. Integrated my Spring boot application with Elastic search through Java High Level Rest Client and I've enabled security by providing below properties after setting up the certificate and passwords: xpack.security.enabled:…
1
vote
1 answer

How to search using multiple fields in Elastic Search through Java high level rest client

I'm new to Elastic search. Successfully implemented search document API for matching single field like below: SearchRequest searchRequest = new SearchRequest(indexName); //Single field match, only for documentId QueryBuilder matchQueryBuilder =…
1
vote
1 answer

How can I parse a GeoPoint value out of an ElasticSearch response in Java?

I am searching an elastic search index from Java using Elastic's high level REST client for JAVA. My response looks like this... { "took": 25, "timed_out": false, "_shards": { "total": 1, "successful": 1, …
1
vote
1 answer

Elastic search Index creation via Highlevel Rest api fails?

I am trying to run an embedded elastic search instance (6.6.10 . then after starting the embedded instance , i am trying to create an index with an index mapping . However i am getting the following…
1
vote
0 answers

Aggregation query using Elastic Search's High Level REST Client for JAVA

I have a working cURL request to search an Elastic Search index with an aggregation query As desired, the response includes a list of values for the specified aggregation field and the count of documents that match each of these values. For example,…
1
vote
1 answer

Why does filterQuery not work in Elastic Search's high level REST client for JAVA?

I am trying to create a function runs a fuzzy search on an Elastic Search index. I only get a match if I specify the term exactly as it is spelled in the index. If I intentionally mispell a single letter in that term like "Boc" , I imagine the…
GNG
  • 1,341
  • 2
  • 23
  • 50