Questions tagged [elasticsearch-java-api]
281 questions
14
votes
1 answer
SocketTimeoutException while retrieving or inserting data into Elastic Search by using Rest High Level Client
I'm facing SocketTimeoutException while retrieving/inserting data from/to elastic. This is happening when there are around 10-30 request/second. These requests are combination of get/put.
Here is my elastic configuration:
3 master nodes each of 4GB…

AshwinK
- 1,039
- 1
- 12
- 31
13
votes
3 answers
How to talk to aws elasticsearch service using elastic java client?
I have set up a elasticsearch server using AWS elasticsearch service (Not EC2). It gave me an endpoint https://xxx-xxxxxxxx.us-west-2.es.amazonaws.com/ and if I click this endpoint(Note that there is no port specified) I can get the expected
{
…

Edmond
- 614
- 2
- 11
- 26
11
votes
2 answers
Elasticsearch 7.x circuit breaker - data too large - troubleshoot
The problem:
Since the upgrading from ES-5.4 to ES-7.2 I started getting "data too large" errors, when trying to write concurrent bulk request (or/and search requests) from my multi-threaded Java application (using…

dorony
- 1,008
- 1
- 14
- 31
11
votes
2 answers
Update By Query in Elasticsearch using Java
I’m currently using Elasticsearch V2.3.1. I want to use the following Elasticsearch query in Java.
POST /twitter/_update_by_query
{
"script": {
"inline": "ctx._source.List = [‘Item 1’,’Item 2’]”
},
"query": {
"term": {
"user":…

A Coder Gamer
- 840
- 1
- 10
- 31
10
votes
3 answers
How to set the query via JSON to an Elasticsearch SearchRequest?
Elasticsearch: 6.1.2
I have an input query via JSON and would like to use the high level Java API to construct a search request using that query data.
String jsonQuery = "..."
SearchRequest searchRequest = new SearchRequest()
SearchSourceBuilder…

Jotschi
- 3,270
- 3
- 31
- 52
10
votes
2 answers
create dummy SearchResponse instance for ElasticSearch test case
I'm trying to create a dummy SearchResponse object by passing the values manually to the constructor. I have a JUnit test class for which I'm using this dummy value to mock the actual method call. Trying with the below method to
public…

bagui
- 844
- 4
- 18
- 37
8
votes
2 answers
How to connect to remote server using Elasticsearch Node Client Java
I am trying to connect to my server using Elasticsearch Java NodeBuilder Client. However I do not see any option to specify my server address and port (like we can do in Transport Client, using addNewTransportAddress("serveraddress", port)). How do…

Arnav Sengupta
- 423
- 1
- 7
- 19
7
votes
1 answer
ElasticSearch - Spring Boot - Upsert is throwing DocumentMissingException
I am using Spring Boot and ElasticSearch. When I am trying to upsert using Spring, it is throwing DocumentMissingException when there is no document present in the ElasticSearch. The same code works fine when there is a document present in the…

Amit
- 33,847
- 91
- 226
- 299
7
votes
1 answer
How Elastic Search delete_by_query work ? What happens when we insert new data and retrieve the same while deleting documents?
I wanted to know more about elastic delete, it's Java high level delete api & weather it's feasible to perform bulk delete.
Following are the config information
Java: 8
Elastic Version: 7.1.1
Elastic dependencies added:
…

AshwinK
- 1,039
- 1
- 12
- 31
7
votes
2 answers
How to do multiple filter query in Elasticsearch using Java?
I have build a web app on top of elasticsearch. I would like to do a multiple filter using Java.
Elasticsearch Query:
{
"query": {
"bool": {
"must": [
{"match": {
"T": "TEXT"},
"match": {
…

Rose
- 1,490
- 5
- 25
- 56
6
votes
2 answers
Can I use newer version of java high level rest client on an older version of elasticsearch?
We are running elasticsearch on AWS which currently supports elasticsearch 6.3 as the latest version.
We have a business case where we need to update all the documents in the index and remove one nested object everyday.
There is elasticsearch's…

deep
- 1,586
- 1
- 18
- 29
6
votes
2 answers
Elasticsearch cluster connection
It might be a dumb question but i was unable to find answer.
If I am having 3 nodes in my cluster so do need to provide the IP and Port of each node while creating transport client so that i can communicate with each node??
new…

Wolverine
- 63
- 4
6
votes
1 answer
How to build multi match query with type set to "phrase_prefix" using Elastic Java Api instead of pure REST
According to the documentation of multi match query (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html) it is possible to search multi properties by prefix. All you must do is to set parameter "type" to…

Wojciech Wirzbicki
- 3,887
- 6
- 36
- 59
6
votes
2 answers
Using ElasticSearch's script_upsert to create a document
According to the official documentation Update API - Upserts one can use scripted_upsert in order to handle update (for existing document) or insert (for new document) form within the script. The thing is they never show how the script should look…

Roee Gavirel
- 18,955
- 12
- 67
- 94
5
votes
1 answer
java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.util.UUID?
Hi I am using java high level rest api client to read some documents from an elastic search index and i am getting the following error .
I get this error when i do perform a request on elasticsearch client as…

KnowledgeSeeker001
- 618
- 9
- 25