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
1
vote
0 answers

Elastic search disable date detection using RestHighLevelClient

one of JSON fields I'm indexing is string in form "2000-01-01". Indexing goes ok, but query operation fails with search_phase_execution_exception, reason=all shards failed. Indexing: IndexRequest request = new…
ernest
  • 51
  • 1
  • 9
1
vote
1 answer

How to get the cluster state or index metadata using RestHighLevelClient?

I am in the process of migrating an app from the TransportClient to the RestHighLevelClient. Right now I have the following method for getting the index metadata: public IndexMetaData getIndexMetaData(String indexAlias) { ClusterState state =…
1
vote
0 answers

Improve ES Agg query - getting circuit_breaking_exception

I run aggregation that on 2 indices: idx-2020-07-21, idx-2020-07-22 The target: Get all documents, but in the case of duplicate id (50% are), get the one from the latest index using the index name. This is the query I'm running { "size": 0, …
1
vote
0 answers

ElasticSearch RestHighLevelClient re-connect on connection reset

I am using Spring + RestHighLevelClient to send data to Elasticsearch restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT) But when the system has been idle for a while, the following exception is thrown java.io.IOException: Connection…
user13674325
  • 339
  • 2
  • 14
1
vote
1 answer

Delete multiple documents from an index in ElasticSearch with value of one of items - 7.8 version

my doc in elsticsearch is like below "hits" : [ { "_index" : "MyIndex", "_type" : "_doc", "_id" : "Lxh7THMBycWRIeJFdwbZ", "_score" : 1.0, "_source" : { "@timestamp" :…
Najme
  • 53
  • 6
1
vote
1 answer

Configure Elasticsearch rest high level client with Basic credential provider

This question was asked in the follow-up question to my this SO answer of how to secure JHLRC in this comment, where I explained how to send Basic Credential in Elasticsearch JHLRC request but it was not at the client level and was at the request…
Amit
  • 30,756
  • 6
  • 57
  • 88
1
vote
4 answers

How to connect Spring boot with Elasticsearch 7.3

I am using Elasticsearch 7.3 and unable to connect it to my Spring boot application in order to use ElasticsearchRepository. @Configuration public class ElasticSearchConfig { @Value("${elasticsearch.host:localhost}") public String host; …
1
vote
1 answer

java elasticsearch HighLevelRestClient throw "java.net.SocketException: Connection reset" intermittently

Basic env: Docker 19.0.3 Elastichsearch 7.6.2 elasticsearch java client 7.6.2 (belongs to spring boot starter data elasticsearch 2.3.0) I was using docker elasticsearch for a spring boot application(also a docker container), and sometimes when i…
Snart
  • 54
  • 6
1
vote
1 answer

java highlevel rest client connection is giving ssl error

I am getting bellow error some time and not able to get search results. 2020-05-26 16:03:30.207 ERROR [default task-284][SearchMVCAction:148] exception in getting response java.io.IOException: Unrecognized SSL message, plaintext connection? at…
Madhava
  • 47
  • 6
1
vote
1 answer

Multiple Elasticsearch connections in a program

I was working on a service in which I get a searchHit from elastic cluster A and then use a field obtained from A to fetch details from elastic cluster B. I have created a class ClientFactory, which creates ES client based on values that I send.…
Nipun Soni
  • 35
  • 5
1
vote
0 answers

Spring boot with ElasticsearchRepository and RestHighLevelClient parameters query

I'm using Spring Boot with ElasticsearchRepository and RestHighLevelClient. I have this query in mt repository class: public interface BillingCycleRepository extends ElasticsearchRepository { List
1
vote
2 answers

Configure Rest High Client with Elastic Search proxy

is there any way to configure my rest high client to connect with es using proxy. My configuration is @Override @Bean public RestHighLevelClient elasticsearchClient() { return new…
A.Sidor
  • 257
  • 4
  • 12
1
vote
0 answers

Elasticsearch Rest High Level Client aggregate fields dynamically

I am trying to generate query dynamically based on the inputs but in the generated query i can see there are only two aggregations are getting generated how can i make each fields to have the separate aggregations below is the code what i have tried…
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

I can't put a geopoint equal to null in elasticsearch

I have the code if(row.get("LATITUDE") != null && row.get("LONGITUDE") != null) { result.put("geoPoint", ImportUtils.getGeoPoint(row));} public static Map getGeoPoint(Map s) { Map