Class CountRequest

    • Constructor Detail

      • CountRequest

        public CountRequest()
      • CountRequest

        public CountRequest​(String... indices)
        Constructs a new count request against the indices. No indices provided here means that count will execute on all indices.
      • CountRequest

        public CountRequest​(String[] indices,
                            QueryBuilder query)
        Constructs a new search request against the provided indices with the given query.
    • Method Detail

      • types

        @Deprecated
        public CountRequest types​(String... types)
        Deprecated.
        Types are in the process of being removed. Instead of using a type, prefer to filter on a field on the document.
        The document types to execute the count against. Defaults to be executed against all types.
      • routing

        public CountRequest routing​(String routing)
        The routing values to control the shards that the search will be executed on.
      • routing

        public CountRequest routing​(String... routings)
        A comma separated list of routing values to control the shards the count will be executed on.
      • indicesOptions

        public CountRequest indicesOptions​(IndicesOptions indicesOptions)
        Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
        See Also:
        IndicesOptions
      • preference

        public CountRequest preference​(String preference)
        Sets the preference to execute the count. Defaults to randomize across shards. Can be set to _local to prefer local shards or a custom value, which guarantees that the same order will be used across different requests.
      • indicesOptions

        public IndicesOptions indicesOptions()
        Description copied from interface: IndicesRequest
        Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
        Specified by:
        indicesOptions in interface IndicesRequest
      • routing

        public String routing()
      • preference

        public String preference()
      • minScore

        public Float minScore()
      • terminateAfter

        public int terminateAfter()
      • terminateAfter

        public CountRequest terminateAfter​(int terminateAfter)
      • types

        @Deprecated
        public String[] types()
        Deprecated.
        Types are in the process of being removed. Instead of using a type, prefer to filter on a field on the document.
      • query

        public QueryBuilder query()
        Returns:
        The provided query to execute with the count request or null if no query was provided.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object