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
1 answer

elasticsearch sorts only by a few fields, and throws an error for others

I have this data structure { "id": "1777410299", "name": "Фий", "moniker": "Страна Россия, Республика Дагестан, Район Ахтынский, Село Фий", "fias": "b8cfa34e-465b-41c0-af72-6c03d3e08fdd", "macrocity": null, "hasMetro": false, …
1
vote
1 answer

ElasticSearch query matching incorrectly

I am trying to match a query based on URL fields. I have an my InsertLink method below that is fired off when someone adds a new link on the webpage. Right now if any link is to be added in with the prefix "https://" or "http://" it automatically…
1
vote
2 answers

ElasticSearch Make Field non-searchable from java

I am currently working on elastic search through my java Application . I know how to index the Java pojo using RestHighLevelClient. How i can make search only on new fields not the complete pojo.? public class Employee{ private long…
Noshaf
  • 207
  • 7
  • 21
1
vote
0 answers

ElasticSearch get distinct all values of one field with Java High Level Client 7.x

I want to get all values of a field from elasticsearch using java high level client. I'm using following code: SearchRequest searchRequest = new SearchRequest(index); SearchSourceBuilder sourceBuilder = new…
1
vote
3 answers

How can I create an elastic search index with the JAVA high level REST client?

I was going through these docs to create an elastic search index from Elastic's high level JAVA REST client. It seems to skip over steps for authenticating with my elastic cloud account. Can someone please point me toward the relevant…
GNG
  • 1,341
  • 2
  • 23
  • 50
1
vote
1 answer

Elasticsearch pagination best approach

We have developed a file storage solution which uses elastic search to store metadata about files using the rest level client java API. We have pagination currently implemented via “from” and “size”. Client makes a call to us specifying the size and…
1
vote
1 answer

Mockito when any java.lang.NullPointerException

I have this method which must be tested: private void processRequest() { BulkRequest request = new BulkRequest(); request.add(new IndexRequest("posts").id("1") .source(XContentType.JSON,"field", "foo")); …
1
vote
2 answers

ElasticSearch 7.6.3 Java HighLevel Rest Client : Auto Suggest across multiple fields - How to implement

We have a index with the following fields and there is a requirement to give an Auto Suggest to the user by searching the data across all text and keyword mapping fields in the index { "settings": { "number_of_shards": 1, …
sivacham
  • 109
  • 2
  • 9
1
vote
1 answer

How to add path parameter in elasticsearch Java bulk Api

I'm using Java bulk Api,Elasticsearch 6.6.2, and expect to POST bulk request as POST //_bulk, but i got POST /_bulk instead (see packet captured below). I know these 2 POST methods are the same, but there're a proxy between my app and ES,…
yongxu
  • 21
  • 5
1
vote
2 answers

Connect Elasticsearch using java

I am new to java coming from python. I know there are lot of answers out there to connect ElasticSearch with java. But it is difficult for me to understand and some are outdated. In python, I can easily import elasticsearch module and connect to…
Paul Steven
  • 93
  • 4
  • 13
1
vote
2 answers

Elastic Search sorting based on search string

Based on text searched by user on UI, I am adding few more searchterms in the search criteria. All these works fine, however I am not able to get the proper sorted result. My expectation would be to get the result sorting in below order: Result on…
Ravi k
  • 11
  • 1
1
vote
2 answers

Returning ResponseEntity with List of an Object

I have the below function where I am trying to return the ResponseEntity with the list of my object. I do not know what am I missing. @RequestMapping(method = RequestMethod.GET, path = "/test") public ResponseEntity>…
Ace
  • 700
  • 7
  • 37
1
vote
1 answer

How to access 2 Elasticsearch Instance through RestHighLevelClient in SpringBoot

I trying to access 2 Elasticsearch Server instance through HighLevelRestClient but I couldn't through this array object HttpHost[] httpHost = new HttpHost(hostName[i...], Integer.parseInt(hostName[i..]), "http"); In hostname i have 2 values in the…
Arun
  • 1,010
  • 6
  • 18
  • 37
1
vote
2 answers

Elasticsearch TransportClient connection [Java]

I am using Elasticsearch in a Java Project using Maven: ... 6.7.0 ... org.elasticsearch
WhiteW
  • 181
  • 1
  • 1
  • 11
0
votes
1 answer

Which elastic api should use for the newer version v8.9 and rest high level client is not present in that version

Exception in thread "main" java.lang.NoSuchMethodError: org.elasticsearch.client.RestHighLevelClient.(Lorg/elasticsearch/client/RestClient;Lorg/elasticsearch/core/CheckedConsumer;Ljava/util/List;Ljava/lang/Boolean;)V at…