Enum SearchType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SearchType>

    public enum SearchType
    extends java.lang.Enum<SearchType>
    Search type represent the manner at which the search operation is executed.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DFS_QUERY_THEN_FETCH
      Same as QUERY_THEN_FETCH, except for an initial scatter phase which goes and computes the distributed term frequencies for more accurate scoring.
      QUERY_AND_FETCH
      Deprecated.
      QUERY_THEN_FETCH
      The query is executed against all shards, but only enough information is returned (not the document content).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SearchType fromId​(byte id)
      Constructs search type based on the internal id.
      static SearchType fromString​(java.lang.String searchType)
      The a string representation search type to execute, defaults to DEFAULT.
      byte id()
      The internal id of the type.
      static SearchType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SearchType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • DFS_QUERY_THEN_FETCH

        public static final SearchType DFS_QUERY_THEN_FETCH
        Same as QUERY_THEN_FETCH, except for an initial scatter phase which goes and computes the distributed term frequencies for more accurate scoring.
      • QUERY_THEN_FETCH

        public static final SearchType QUERY_THEN_FETCH
        The query is executed against all shards, but only enough information is returned (not the document content). The results are then sorted and ranked, and based on it, only the relevant shards are asked for the actual document content. The return number of hits is exactly as specified in size, since they are the only ones that are fetched. This is very handy when the index has a lot of shards (not replicas, shard id groups).
      • QUERY_AND_FETCH

        @Deprecated
        public static final SearchType QUERY_AND_FETCH
        Deprecated.
        Only used for pre 5.3 request where this type is still needed
    • Field Detail

      • CURRENTLY_SUPPORTED

        public static final SearchType[] CURRENTLY_SUPPORTED
        Non-deprecated types
    • Method Detail

      • values

        public static SearchType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SearchType c : SearchType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SearchType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • id

        public byte id()
        The internal id of the type.
      • fromId

        public static SearchType fromId​(byte id)
        Constructs search type based on the internal id.
      • fromString

        public static SearchType fromString​(java.lang.String searchType)
        The a string representation search type to execute, defaults to DEFAULT. Can be one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch", "query_then_fetch"/"queryThenFetch" and "query_and_fetch"/"queryAndFetch".