Class

com.sksamuel.elastic4s.searches

SearchDefinition

Related Doc: package searches

Permalink

case class SearchDefinition(indexesTypes: IndexesAndTypes, aggs: Seq[AggregationDefinition] = Nil, explain: Option[Boolean] = None, fetchContext: Option[FetchSourceContext] = None, from: Option[Int] = None, indicesOptions: Option[IndicesOptions] = None, inners: Seq[InnerHitDefinition] = Nil, indexBoosts: Seq[(String, Double)] = Nil, keepAlive: Option[String] = None, highlight: Option[Highlight] = None, minScore: Option[Double] = None, pref: Option[String] = None, query: Option[QueryDefinition] = None, postFilter: Option[QueryDefinition] = None, requestCache: Option[Boolean] = None, rescorers: Seq[RescoreDefinition] = Nil, scriptFields: Seq[ScriptFieldDefinition] = Nil, sorts: Seq[SortDefinition] = Nil, storedFields: Seq[String] = Nil, suggs: Seq[SuggestionDefinition] = Nil, size: Option[Int] = None, routing: Option[String] = None, stats: Seq[String] = Nil, searchType: Option[SearchType] = None, searchAfter: Seq[Any] = Nil, trackScores: Option[Boolean] = None, terminateAfter: Option[Int] = None, timeout: Option[Duration] = None, version: Option[Boolean] = None) extends Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SearchDefinition
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SearchDefinition(indexesTypes: IndexesAndTypes, aggs: Seq[AggregationDefinition] = Nil, explain: Option[Boolean] = None, fetchContext: Option[FetchSourceContext] = None, from: Option[Int] = None, indicesOptions: Option[IndicesOptions] = None, inners: Seq[InnerHitDefinition] = Nil, indexBoosts: Seq[(String, Double)] = Nil, keepAlive: Option[String] = None, highlight: Option[Highlight] = None, minScore: Option[Double] = None, pref: Option[String] = None, query: Option[QueryDefinition] = None, postFilter: Option[QueryDefinition] = None, requestCache: Option[Boolean] = None, rescorers: Seq[RescoreDefinition] = Nil, scriptFields: Seq[ScriptFieldDefinition] = Nil, sorts: Seq[SortDefinition] = Nil, storedFields: Seq[String] = Nil, suggs: Seq[SuggestionDefinition] = Nil, size: Option[Int] = None, routing: Option[String] = None, stats: Seq[String] = Nil, searchType: Option[SearchType] = None, searchAfter: Seq[Any] = Nil, trackScores: Option[Boolean] = None, terminateAfter: Option[Int] = None, timeout: Option[Duration] = None, version: Option[Boolean] = None)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def aggregations(first: AggregationDefinition, rest: AggregationDefinition*): SearchDefinition

    Permalink
  5. def aggregations(aggs: Iterable[AggregationDefinition]): SearchDefinition

    Permalink
  6. def aggs(iterable: Iterable[AggregationDefinition]): SearchDefinition

    Permalink
  7. def aggs(first: AggregationDefinition, rest: AggregationDefinition*): SearchDefinition

    Permalink
  8. val aggs: Seq[AggregationDefinition]

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def bool(block: ⇒ BoolQueryDefinition): SearchDefinition

    Permalink
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def explain(enabled: Boolean): SearchDefinition

    Permalink
  14. val explain: Option[Boolean]

    Permalink
  15. def extraSource(json: String): SearchDefinition

    Permalink

    Sets the source of the request as a json string.

    Sets the source of the request as a json string. Allows setting other parameters. Unlike rawQuery, setExtraSource is parsed at the "root" level Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.

    Example:

    search in "*" types("users", "tweets") limit 5 extraSource {
    """{ "query": { "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } } }"""
    } searchType SearchType.Scan
  16. def fetchContext(context: FetchSourceContext): SearchDefinition

    Permalink
  17. val fetchContext: Option[FetchSourceContext]

    Permalink
  18. def fetchSource(fetch: Boolean): SearchDefinition

    Permalink
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def from(i: Int): SearchDefinition

    Permalink
  21. val from: Option[Int]

    Permalink
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. val highlight: Option[Highlight]

    Permalink
  24. def highlighting(options: HighlightOptionsDefinition, fields: Iterable[HighlightFieldDefinition]): SearchDefinition

    Permalink
  25. def highlighting(options: HighlightOptionsDefinition, first: HighlightFieldDefinition, rest: HighlightFieldDefinition*): SearchDefinition

    Permalink
  26. def highlighting(fields: Iterable[HighlightFieldDefinition]): SearchDefinition

    Permalink
  27. def highlighting(first: HighlightFieldDefinition, rest: HighlightFieldDefinition*): SearchDefinition

    Permalink
  28. def indexBoost(tuples: (String, Double)*): SearchDefinition

    Permalink
  29. def indexBoost(map: Map[String, Double]): SearchDefinition

    Permalink
  30. val indexBoosts: Seq[(String, Double)]

    Permalink
  31. val indexesTypes: IndexesAndTypes

    Permalink
  32. def indicesOptions(options: IndicesOptions): SearchDefinition

    Permalink
  33. val indicesOptions: Option[IndicesOptions]

    Permalink
  34. def inner(inners: Iterable[InnerHitDefinition]): SearchDefinition

    Permalink
  35. def inner(first: InnerHitDefinition, rest: InnerHitDefinition*): SearchDefinition

    Permalink
  36. val inners: Seq[InnerHitDefinition]

    Permalink
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. val keepAlive: Option[String]

    Permalink
  39. def limit(i: Int): SearchDefinition

    Permalink
  40. def matchAllQuery(): SearchDefinition

    Permalink
  41. def matchQuery(field: String, value: Any): SearchDefinition

    Permalink
  42. def minScore(min: Double): SearchDefinition

    Permalink
  43. val minScore: Option[Double]

    Permalink
  44. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  45. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  47. def postFilter(block: ⇒ QueryDefinition): SearchDefinition

    Permalink
  48. val postFilter: Option[QueryDefinition]

    Permalink
  49. val pref: Option[String]

    Permalink
  50. def preference(pref: String): SearchDefinition

    Permalink
  51. def preference(pref: org.elasticsearch.cluster.routing.Preference): SearchDefinition

    Permalink
  52. def prefix(name: String, value: Any): SearchDefinition

    Permalink
  53. def query(q: QueryDefinition): SearchDefinition

    Permalink
  54. def query(string: String): SearchDefinition

    Permalink

    Adds a single string query to this search

    Adds a single string query to this search

    string

    the query string

  55. val query: Option[QueryDefinition]

    Permalink
  56. def rawQuery(json: String): SearchDefinition

    Permalink

    Expects a query in json format and sets the query of the search request.

    Expects a query in json format and sets the query of the search request. i.e. underneath a "query" field if referencing HTTP API Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.

    Example:

    search in "*" types("users", "tweets") limit 5 rawQuery {
    """{ "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } }"""
    } searchType SearchType.Scan
  57. def regexQuery(field: String, value: String): SearchDefinition

    Permalink
  58. def regexQuery(tuple: (String, String)): SearchDefinition

    Permalink
  59. def requestCache(requestCache: Boolean): SearchDefinition

    Permalink
  60. val requestCache: Option[Boolean]

    Permalink
  61. def rescore(rescorers: Iterable[RescoreDefinition]): SearchDefinition

    Permalink
  62. def rescore(first: RescoreDefinition, rest: RescoreDefinition*): SearchDefinition

    Permalink
  63. val rescorers: Seq[RescoreDefinition]

    Permalink
  64. def routing(r: String): SearchDefinition

    Permalink
  65. val routing: Option[String]

    Permalink
  66. val scriptFields: Seq[ScriptFieldDefinition]

    Permalink
  67. def scriptfields(fields: Iterable[ScriptFieldDefinition]): SearchDefinition

    Permalink
  68. def scriptfields(fields: ScriptFieldDefinition*): SearchDefinition

    Permalink

    This method introduces zero or more script field definitions into the search construction

    This method introduces zero or more script field definitions into the search construction

    fields

    zero or more ScriptFieldDefinition instances

    returns

    this, an instance of SearchDefinition

  69. def scroll(keepAlive: String): SearchDefinition

    Permalink
  70. def searchAfter(values: Seq[Any]): SearchDefinition

    Permalink
  71. val searchAfter: Seq[Any]

    Permalink
  72. def searchType(searchType: SearchType): SearchDefinition

    Permalink
  73. val searchType: Option[SearchType]

    Permalink
  74. def size(i: Int): SearchDefinition

    Permalink
  75. val size: Option[Int]

    Permalink
  76. def sortBy(sorts: Iterable[SortDefinition]): SearchDefinition

    Permalink
  77. def sortBy(sorts: SortDefinition*): SearchDefinition

    Permalink
  78. val sorts: Seq[SortDefinition]

    Permalink
  79. def source(json: String): SearchDefinition

    Permalink

    Sets the source of the request as a json string.

    Sets the source of the request as a json string. Note, setting anything other than the search type will cause this source to be overridden, consider using #setExtraSource(String).

    Unlike rawQuery, setExtraSource is parsed at the "root" level Query must be valid json beginning with '{' and ending with '}'. Field names must be double quoted.

    Example:

    search in "*" types("users", "tweets") limit 5 extraSource {
    """{ "query": { "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } } }"""
    } searchType SearchType.Scan
  80. def sourceExclude(excludes: Iterable[String]): SearchDefinition

    Permalink
  81. def sourceExclude(first: String, rest: String*): SearchDefinition

    Permalink
  82. def sourceFiltering(includes: Iterable[String], excludes: Iterable[String]): SearchDefinition

    Permalink
  83. def sourceInclude(includes: Iterable[String]): SearchDefinition

    Permalink
  84. def sourceInclude(first: String, rest: String*): SearchDefinition

    Permalink
  85. def start(i: Int): SearchDefinition

    Permalink
  86. def stats(groups: String*): SearchDefinition

    Permalink
  87. val stats: Seq[String]

    Permalink
  88. def storedFields(fields: Iterable[String]): SearchDefinition

    Permalink
  89. def storedFields(first: String, rest: String*): SearchDefinition

    Permalink
  90. val storedFields: Seq[String]

    Permalink
  91. def suggestion(sugg: SuggestionDefinition): SearchDefinition

    Permalink
  92. def suggestions(suggs: Iterable[SuggestionDefinition]): SearchDefinition

    Permalink
  93. def suggestions(first: SuggestionDefinition, rest: SuggestionDefinition*): SearchDefinition

    Permalink

    Adds a new suggestion to the search request, which can be looked up in the response using the name provided.

  94. val suggs: Seq[SuggestionDefinition]

    Permalink
  95. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  96. def termQuery(field: String, value: Any): SearchDefinition

    Permalink
  97. def termQuery(tuple: (String, Any)): SearchDefinition

    Permalink
  98. def terminateAfter(terminateAfter: Int): SearchDefinition

    Permalink

    The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.

    The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field terminated_early to indicate whether the query execution has actually terminated early. Defaults to no.

  99. val terminateAfter: Option[Int]

    Permalink
  100. def timeout(duration: FiniteDuration): SearchDefinition

    Permalink
  101. val timeout: Option[Duration]

    Permalink
  102. def trackScores(enabled: Boolean): SearchDefinition

    Permalink
  103. val trackScores: Option[Boolean]

    Permalink
  104. def types(types: Iterable[String]): SearchDefinition

    Permalink
  105. def types(first: String, rest: String*): SearchDefinition

    Permalink
  106. def version(version: Boolean): SearchDefinition

    Permalink
  107. val version: Option[Boolean]

    Permalink
  108. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  110. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def fields(fields: String*): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) Renamed to storedFields

  2. def matchAll(): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.2.0) Use matchAllQuery()

  3. def preference(pref: Preference): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.2.0) Use the elasticsearch enum rather than the elastic4s one

  4. def regex(tuple: (String, String)): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use regexQuery(...)

  5. def sort(sorts: SortDefinition*): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use sortBy

  6. def term(field: String, value: Any): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use termQuery()

  7. def term(tuple: (String, Any)): SearchDefinition

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use termQuery()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped