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

how to translate nested elastic search query in java?

Below query will do filter and aggregation how to translate this to java code. Query works from postman the same needs to be converted into java using java client api. and i am using rest high level client as elastic search client. i tried with the…
2
votes
2 answers

Elasticsearch Search Scroll API doesn't retrieve all the documents from an index

I would like to retrieve all the documents from Elasticsearch, so I referred to the Search Scroll API. But my question is, it is not returning all the documents, I have 36 documents in one index, for that it was returning 26 only. Even when I…
2
votes
1 answer

mget producing: Unable to parse response body for Response

I'm issuing a Multi-Get request via the Java High Level REST Client and I'm receiving the following exception: "Unable to parse response body for Response{requestLine=POST /_mget HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 200 OK}" I…
spottedmahn
  • 14,823
  • 13
  • 108
  • 178
2
votes
1 answer

Elastic Search High Level Java Client UpdateByQueryRequest API help required

I am migrating from normal ES Http calls to ES HighLevelJavaClient. I want to convert this old implementation POST /_update_by_query { "script": { "inline": "ctx._source.collibra_match_for = []" }, "query": { "bool": { …
Abhishek Sengupta
  • 2,938
  • 1
  • 28
  • 35
1
vote
1 answer

RestHighLevelClient to index the documents to a remote host?

I am trying to index to a remote elastic host but RestHighLevelClient by default is picking up the "localhost:9200" . is there any where i can configure the RestHighLevelClient to use a remote host instead of localhost? I have researched enough on…
1
vote
1 answer

How to use mockito for elasticSearchClient while updating?

Note client is RestHightLevelClient, @Override public void createAlias(final String aliasName, final String indexName, final boolean writable) throws IOException { IndicesAliasesRequest request = new IndicesAliasesRequest(); …
1
vote
1 answer

How to remove all aggregation from a SearchSourceBuilder fully?

I have a SearchSourceBuilder which has all blocks like Query,From, Size, Aggregations etc. But later I want to remove only the Aggregations blocks for some use case fully before sending the DSL to ES. Example, I need to remove the entire…
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

Elasticsearch exception [type=action_request_validation_exception, reason=Validation Failed: 1: type is missing;

I am trying to do bulk insert using elastic search rest high-level client, getting type missing validation error. My pom.xml has the following dependency versions org.springframework.boot
Ayesha
  • 15
  • 1
  • 4
1
vote
1 answer

Spring Boot, query Elasticsearch specific fields from already indexed data created by Elastic Stack

The target is to query specific fields from an index via a spring boot app. Questions in the end. The data in elasticsearch are created from Elastic Stack with Beats and Logstash etc. There is some inconsistency, eg some fields may be missing on…
1
vote
0 answers

Using SliceBuilder with Elastic RestHighLevelClient to achieve parallelism in elastic search

I need to fetch more than 1,000,000 records from Elasticsearch using Java RestHighLevelClient I am using scroll for pagination and everything is working fine. Code Looks like something this: class ScrollTest { final static RestHighLevelClient…
sam
  • 47
  • 6
1
vote
0 answers

Avoiding conflicts with elastic upsert

I am having an issue trying to implement optimistic locking when executing a document upsert. I followed all the guides, however I am getting the following error: Validation Failed: 1: compare and write operations can not be used with upsert; I can…
1
vote
1 answer

Designing ElasticSearch Migration from 6.8 to 7.16 along with App Deployment

I have a Spring Boot application that uses ElasticSearch 6.8 and I would like to migrate it to Elasticsearch 7.16 with least downtime. I can do rolling update but the problem with migration is that when I migrate my ES cluster from version 6 to 7,…
1
vote
1 answer

Multi_Match Vs Query_String_Query?

I am using ES 7.10.2 I have fields with keyword and text mappings. When user specifies the search string, I wanted to parse the pieces of search string, then match each of those piece to each specific field, in the specific way that field mapping…
1
vote
0 answers

Nesting boolQueryBuilder in elasticSearch v5.6 in RestHighLevel client(JAVA)

I use boolQueryBuilder for evaluating queries like (name:xxx OR grade:y) but I need to evaluate queries like (name:[x AND z] OR grade:y), I need to use java's restHighLevel client to do this. In order to do this I need to nest boolQueryBuilder, can…
1
2
3
10 11