Skip to content
Advertisement

Tag: resthighlevelclient

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. 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

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

Advertisement