java-builders.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132
  1. [[java-rest-high-java-builders]]
  2. == Using Java Builders
  3. The Java High Level REST Client depends on the Elasticsearch core project which provides
  4. different types of Java `Builders` objects, including:
  5. Query Builders::
  6. The query builders are used to create the query to execute within a search request. There
  7. is a query builder for every type of query supported by the Query DSL. Each query builder
  8. implements the `QueryBuilder` interface and allows to set the specific options for a given
  9. type of query. Once created, the `QueryBuilder` object can be set as the query parameter of
  10. `SearchSourceBuilder`. The <<java-rest-high-document-search-request-building-queries, Search Request>>
  11. page shows an example of how to build a full search request using `SearchSourceBuilder` and
  12. `QueryBuilder` objects. The <<java-rest-high-query-builders, Building Search Queries>> page
  13. gives a list of all available search queries with their corresponding `QueryBuilder` objects
  14. and `QueryBuilders` helper methods.
  15. Aggregation Builders::
  16. Similarly to query builders, the aggregation builders are used to create the aggregations to
  17. compute during a search request execution. There is an aggregation builder for every type of
  18. aggregation (or pipeline aggregation) supported by Elasticsearch. All builders extend the
  19. `AggregationBuilder` class (or `PipelineAggregationBuilder`class). Once created, `AggregationBuilder`
  20. objects can be set as the aggregation parameter of `SearchSourceBuilder`. There is a example
  21. of how `AggregationBuilder` objects are used with `SearchSourceBuilder` objects to define the aggregations
  22. to compute with a search query in <<java-rest-high-document-search-request-building-aggs, Search Request>> page.
  23. The <<java-rest-high-aggregation-builders, Building Aggregations>> page gives a list of all available
  24. aggregations with their corresponding `AggregationBuilder` objects and `AggregationBuilders` helper methods.
  25. include::query-builders.asciidoc[]
  26. include::aggs-builders.asciidoc[]