- Java REST Client (deprecated): other versions:
- Overview
- Java Low Level REST Client
- Java High Level REST Client
- Getting started
- Document APIs
- Search APIs
- Miscellaneous APIs
- Indices APIs
- Analyze API
- Create Index API
- Delete Index API
- Indices Exists API
- Open Index API
- Close Index API
- Shrink Index API
- Split Index API
- Refresh API
- Flush API
- Flush Synced API
- Clear Cache API
- Force Merge API
- Rollover Index API
- Put Mapping API
- Get Mappings API
- Get Field Mappings API
- Index Aliases API
- Exists Alias API
- Get Alias API
- Update Indices Settings API
- Get Settings API
- Put Template API
- Validate Query API
- Get Templates API
- Get Index API
- Cluster APIs
- Ingest APIs
- Snapshot APIs
- Tasks APIs
- Script APIs
- Watcher APIs
- Using Java Builders
- Migration Guide
- License
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Using Java Builders
editUsing Java Builders
editThe Java High Level REST Client depends on the Elasticsearch core project which provides
different types of Java Builders
objects, including:
- Query Builders
-
The query builders are used to create the query to execute within a search request. There
is a query builder for every type of query supported by the Query DSL. Each query builder
implements the
QueryBuilder
interface and allows to set the specific options for a given type of query. Once created, theQueryBuilder
object can be set as the query parameter ofSearchSourceBuilder
. The Search Request page shows an example of how to build a full search request usingSearchSourceBuilder
andQueryBuilder
objects. The Building Search Queries page gives a list of all available search queries with their correspondingQueryBuilder
objects andQueryBuilders
helper methods. - Aggregation Builders
-
Similarly to query builders, the aggregation builders are used to create the aggregations to
compute during a search request execution. There is an aggregation builder for every type of
aggregation (or pipeline aggregation) supported by Elasticsearch. All builders extend the
AggregationBuilder
class (orPipelineAggregationBuilder`class). Once created, `AggregationBuilder
objects can be set as the aggregation parameter ofSearchSourceBuilder
. There is a example of howAggregationBuilder
objects are used withSearchSourceBuilder
objects to define the aggregations to compute with a search query in Search Request page. The Building Aggregations page gives a list of all available aggregations with their correspondingAggregationBuilder
objects andAggregationBuilders
helper methods.
Was this helpful?
Thank you for your feedback.