ElasticSearch Java API search over given source

Hello, extreme noob here.

I am using Java API, and I have some objects with String fields that I want to scan for matches. How can I pull that of using elasticsearch ? I've read lots of tutorials but none of them shows how to execute the search over a given set.

Thanks in advance.

You have an example here: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-search.html

SearchRequest searchRequest = new SearchRequest(); 
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); 
searchSourceBuilder.query(QueryBuilders.matchAllQuery()); 
searchRequest.source(searchSourceBuilder); 
SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.