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

Elastic API custom date field range query

I'm learning Elasticsearch API while practicing I'm facing the issue is unable to fetch documents between two dates those documents match two fields but without date range it's working fine BoolQueryBuilder filter = new BoolQueryBuilder(); …
nay
  • 95
  • 12
0
votes
1 answer

How to form index stats API?

ES Version : 7.10.2 I have a requirement to show index statistics, I have come across the index stats API which does fulfill my requirement. But the issue is I don't necessarily need all the fields for a particular metric. Ex: curl -XGET…
0
votes
1 answer

Invoke Search Template URI using RestHighLevelClient

We are trying to query from ElasticSearchDB the pseudo code is as shown below. public String searchMovieRelease(){ String movieRelease=null; WebTarget webTarget = target.path("_search/template"); (1) Invocation.Builder builder =…
User27854
  • 824
  • 1
  • 16
  • 40
0
votes
1 answer

Elastic Search how to form a SourceBuilder instance from a string. gives named objects are not supported for this parser

There is an api which returns a elastic search query with placeholders. Once this query string is obtained I need to update the placeholders and then create a SearchSourceBuilder instance. Using the searchInstance, I need to create a SearchRequest…
User27854
  • 824
  • 1
  • 16
  • 40
0
votes
1 answer

Java Mocking a private final field or response form RestHighLevelClient

I am trying to write a testcase for the below method and I need to mock the response obtained from the elastic search db. @Inject ESEntity mockElasticSearchEntity; private final RestHighLevelClient restHighLevelClient =…
User27854
  • 824
  • 1
  • 16
  • 40
0
votes
1 answer

Multiple queries in E v5.6 REST high level client

How can I have multiple query in Search API in elasticsearch v5.6 in rest high level client? I need to have OR and AND queries in the search query. I've been using searchSourceBuilder, it only has one matchQuery. QueryBuilder matchQueryBuilder =…
0
votes
1 answer

Handling Array Indexes When Searching In ElasticSearch

I have a problem with my ES queries where they fail because of having array indexes in their query strings. This happens because my following approach. I flatten the JSON requests that I get with the following method. private void…
AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
0
votes
0 answers

Getting search_phase_execution_exception when making a SearchRequest with sort options

Used the Java RestHighLevelClient 7.4.2 to make an org.elasticsearch.action.search.SearchRequest in conjunction with org.elasticsearch.search.sort.FieldSortBuilder. It returned the following ElasticsearchStatusException[Elasticsearch exception…
Ridhwaan Shakeel
  • 981
  • 1
  • 20
  • 39
0
votes
1 answer

Elasticsearch - what the best way to find all indices between two dates for rotating index set up using Java client

Our set up in ES ( 7.x) is to rotate indexes every day in format indexName-yyyy-MM-dd I'm trying to find the best way to predict the indexes between two days so I can include them in a search request in Java Rest high-level client As the guide…
0
votes
1 answer

How to determine the correct size for terms aggregation, which will produce accurate aggregation results?

As I read through document for Terms Aggregation, I came across the fact that the results from Term Aggregation are not always accurate, but we can increase the size to get the accurate results. I know : - How Query-Then-Fetch works. How top terms…
0
votes
0 answers

Error in per bucket doc_count_error_upper_bound for Term Aggregation?

Below configuration for Elasticsearch: 1 Cluster 1 Node 1 Index 3 Shards (1 Replica shard for each primary, but in UNASSIGNED state as there is only 1 node). I have indexed document and those are spread across 3 Shards(Shard-0,…
0
votes
2 answers

Does Elasticsearch accept 1 or 0 for searching on boolean field?

this is part of my elasticsearch query: { "match": { "value": { "query": "1", } } } value is a boolean field in my index, does elasticsearch accept 1 as true and 0 as false in search on the boolean field?
saba safavi
  • 160
  • 7
  • 20
0
votes
1 answer

How to hit ElasticSearch using Apache HttpClient

I have SearchRequest object with all the Elasticsearch(ES) query data set. I cannot use RestHighLevel client for my usecase because it requires endpoint need to be passed at the time of instantiation. I gets ES endpoint dynamically based on some…
priyadhingra19
  • 333
  • 4
  • 15
0
votes
1 answer

Does Elastic High Level Rest Client need connection pool implements on my own in appliation

I use high-level-rest-client as my java client in my applicaton, and just use it by autowiring highRestClient in my business service code, not unlike using some connection pool in database connecting. For now, its performance is ok, but I wonder…
0
votes
1 answer

How to prevent RestHighLevelClient from connecting to elasticsearch while creating a bean for test

I have a configuration class that creates RestHighLevelClient and ElasticsearchOperations, they work very well when I start the application. Unfortunately, I am facing an issue with tests. My configuration class: @ComponentScan(basePackages =…