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. Thanks in advance! Answer You can use something like: BoolQueryBuilder finalQuery = QueryBuilders.boolQuery(); For OR clauses you can use: finalQuery.should().add(your query); For
Tag: resthighlevelclient
Find total amount of disk space used by a Elasticsearch cluster
I am looking for a way to get the total amount of disk space used by a Elasticsearch cluster. I have found suggestions to use the following REST API endpoints to obtain this information among other things: I was wondering can the same information be obtained using the Elasticsearch Java High-Level REST Client or the Transport Client in an older
Spring Boot + Elastic Search : Connection Refused with Java RestHighLevelClient
I am implementing an elastic pool for my spring boot project also I am using spring boot 2.1.4 and elastic search 7.3.0. I am stuck at this. When any API trying to query it gives java.net.ConnectException: Connection refused. I want to use configuration with customizeHttpClient with a setting thread count. So It makes only one connection when application will start
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. (A’s or B’s) But after getting details from A, I’m not able to
Elasticsearch TransportClient connection [Java]
I am using Elasticsearch in a Java Project using Maven: When I try to initialize a TransportClient in order to index a document it gives me the error: Maybe a need to add more information in config/elasticsearch.yaml about transportartion or the current configuration is wrong. Java code: elasticsearch.yaml: (The other info inside elasticsearch.yaml is commented) localhost:9200 gives me: Answer I