Class SearchMvtRequest.Builder

All Implemented Interfaces:
WithJson<SearchMvtRequest.Builder>, ObjectBuilder<SearchMvtRequest>
Enclosing class:
SearchMvtRequest

public static class SearchMvtRequest.Builder extends RequestBase.AbstractBuilder<SearchMvtRequest.Builder> implements ObjectBuilder<SearchMvtRequest>
Builder for SearchMvtRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • aggs

      public final SearchMvtRequest.Builder aggs(Map<String,Aggregation> map)
      Sub-aggregations for the geotile_grid.

      It supports the following aggregation types:

      • avg
      • boxplot
      • cardinality
      • extended stats
      • max
      • median absolute deviation
      • min
      • percentile
      • percentile-rank
      • stats
      • sum
      • value count

      The aggregation names can't start with _mvt_. The _mvt_ prefix is reserved for internal aggregations.

      API name: aggs

      Adds all entries of map to aggs.

    • aggs

      public final SearchMvtRequest.Builder aggs(String key, Aggregation value)
      Sub-aggregations for the geotile_grid.

      It supports the following aggregation types:

      • avg
      • boxplot
      • cardinality
      • extended stats
      • max
      • median absolute deviation
      • min
      • percentile
      • percentile-rank
      • stats
      • sum
      • value count

      The aggregation names can't start with _mvt_. The _mvt_ prefix is reserved for internal aggregations.

      API name: aggs

      Adds an entry to aggs.

    • aggs

      public final SearchMvtRequest.Builder aggs(String key, AggregationVariant value)
      Sub-aggregations for the geotile_grid.

      It supports the following aggregation types:

      • avg
      • boxplot
      • cardinality
      • extended stats
      • max
      • median absolute deviation
      • min
      • percentile
      • percentile-rank
      • stats
      • sum
      • value count

      The aggregation names can't start with _mvt_. The _mvt_ prefix is reserved for internal aggregations.

      API name: aggs

      Adds an entry to aggs.

    • aggs

      Sub-aggregations for the geotile_grid.

      It supports the following aggregation types:

      • avg
      • boxplot
      • cardinality
      • extended stats
      • max
      • median absolute deviation
      • min
      • percentile
      • percentile-rank
      • stats
      • sum
      • value count

      The aggregation names can't start with _mvt_. The _mvt_ prefix is reserved for internal aggregations.

      API name: aggs

      Adds an entry to aggs using a builder lambda.

    • buffer

      public final SearchMvtRequest.Builder buffer(@Nullable Integer value)
      The size, in pixels, of a clipping buffer outside the tile. This allows renderers to avoid outline artifacts from geometries that extend past the extent of the tile.

      API name: buffer

    • exactBounds

      public final SearchMvtRequest.Builder exactBounds(@Nullable Boolean value)
      If false, the meta layer's feature is the bounding box of the tile. If true, the meta layer's feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on <field> values that intersect the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.

      API name: exact_bounds

    • extent

      public final SearchMvtRequest.Builder extent(@Nullable Integer value)
      The size, in pixels, of a side of the tile. Vector tiles are square with equal sides.

      API name: extent

    • field

      public final SearchMvtRequest.Builder field(String value)
      Required - Field containing geospatial data to return

      API name: field

    • fields

      public final SearchMvtRequest.Builder fields(List<String> list)
      The fields to return in the hits layer. It supports wildcards (*). This parameter does not support fields with array values. Fields with array values may return inconsistent results.

      API name: fields

      Adds all elements of list to fields.

    • fields

      public final SearchMvtRequest.Builder fields(String value, String... values)
      The fields to return in the hits layer. It supports wildcards (*). This parameter does not support fields with array values. Fields with array values may return inconsistent results.

      API name: fields

      Adds one or more values to fields.

    • gridAgg

      public final SearchMvtRequest.Builder gridAgg(@Nullable GridAggregationType value)
      The aggregation used to create a grid for the field.

      API name: grid_agg

    • gridPrecision

      public final SearchMvtRequest.Builder gridPrecision(@Nullable Integer value)
      Additional zoom levels available through the aggs layer. For example, if <zoom> is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don't include the aggs layer.

      API name: grid_precision

    • gridType

      public final SearchMvtRequest.Builder gridType(@Nullable GridType value)
      Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If grid, each feature is a polygon of the cells bounding box. If point`, each feature is a Point that is the centroid of the cell.

      API name: grid_type

    • index

      public final SearchMvtRequest.Builder index(List<String> list)
      Required - Comma-separated list of data streams, indices, or aliases to search

      API name: index

      Adds all elements of list to index.

    • index

      public final SearchMvtRequest.Builder index(String value, String... values)
      Required - Comma-separated list of data streams, indices, or aliases to search

      API name: index

      Adds one or more values to index.

    • query

      public final SearchMvtRequest.Builder query(@Nullable Query value)
      The query DSL used to filter documents for the search.

      API name: query

    • query

      The query DSL used to filter documents for the search.

      API name: query

    • query

      public final SearchMvtRequest.Builder query(QueryVariant value)
      The query DSL used to filter documents for the search.

      API name: query

    • runtimeMappings

      public final SearchMvtRequest.Builder runtimeMappings(Map<String,RuntimeField> map)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds all entries of map to runtimeMappings.

    • runtimeMappings

      public final SearchMvtRequest.Builder runtimeMappings(String key, RuntimeField value)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds an entry to runtimeMappings.

    • runtimeMappings

      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds an entry to runtimeMappings using a builder lambda.

    • size

      public final SearchMvtRequest.Builder size(@Nullable Integer value)
      The maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don't include the hits layer.

      API name: size

    • sort

      public final SearchMvtRequest.Builder sort(List<SortOptions> list)
      Sort the features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box's diagonal length, from longest to shortest.

      API name: sort

      Adds all elements of list to sort.

    • sort

      public final SearchMvtRequest.Builder sort(SortOptions value, SortOptions... values)
      Sort the features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box's diagonal length, from longest to shortest.

      API name: sort

      Adds one or more values to sort.

    • sort

      Sort the features in the hits layer. By default, the API calculates a bounding box for each feature. It sorts features based on this box's diagonal length, from longest to shortest.

      API name: sort

      Adds a value to sort using a builder lambda.

    • trackTotalHits

      public final SearchMvtRequest.Builder trackTotalHits(@Nullable TrackHits value)
      The number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

      API name: track_total_hits

    • trackTotalHits

      The number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query.

      API name: track_total_hits

    • withLabels

      public final SearchMvtRequest.Builder withLabels(@Nullable Boolean value)
      If true, the hits and aggs layers will contain additional point features representing suggested label positions for the original features.
      • Point and MultiPoint features will have one of the points selected.
      • Polygon and MultiPolygon features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.
      • LineString features will likewise provide a roughly central point selected from the triangle-tree.
      • The aggregation results will provide one central point for each aggregation bucket.

      All attributes from the original features will also be copied to the new label features. In addition, the new features will be distinguishable using the tag _mvt_label_position.

      API name: with_labels

    • x

      public final SearchMvtRequest.Builder x(int value)
      Required - X coordinate for the vector tile to search

      API name: x

    • y

      public final SearchMvtRequest.Builder y(int value)
      Required - Y coordinate for the vector tile to search

      API name: y

    • zoom

      public final SearchMvtRequest.Builder zoom(int value)
      Required - Zoom level for the vector tile to search

      API name: zoom

    • self

      protected SearchMvtRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<SearchMvtRequest.Builder>
    • build

      public SearchMvtRequest build()
      Specified by:
      build in interface ObjectBuilder<SearchMvtRequest>
      Throws:
      NullPointerException - if some of the required fields are null.