Class

com.sksamuel.elastic4s.requests.searches

SearchRequest

Related Doc: package searches

Permalink

case class SearchRequest(indexes: Indexes, aggs: Seq[AbstractAggregation] = Nil, collapse: Option[CollapseRequest] = None, docValues: Seq[String] = Nil, scriptFields: Seq[ScriptField] = Nil, storedFields: Seq[String] = Nil, fetchContext: Option[FetchSourceContext] = None, pref: Option[String] = None, routing: Option[String] = None, terminateAfter: Option[Int] = None, timeout: Option[Duration] = None, minScore: Option[Double] = None, rescorers: Seq[Rescore] = Nil, trackScores: Option[Boolean] = None, indicesOptions: Option[IndicesOptionsRequest] = None, inners: Seq[InnerHit] = Nil, indexBoosts: Seq[(String, Double)] = Nil, keepAlive: Option[String] = None, highlight: Option[Highlight] = None, query: Option[Query] = None, postFilter: Option[Query] = None, requestCache: Option[Boolean] = None, sorts: Seq[Sort] = Nil, suggs: Seq[Suggestion] = Nil, globalSuggestionText: Option[String] = None, from: Option[Int] = None, size: Option[Int] = None, slice: Option[(Int, Int)] = None, explain: Option[Boolean] = None, stats: Seq[String] = Nil, searchType: Option[SearchType] = None, searchAfter: Seq[Any] = Nil, version: Option[Boolean] = None, profile: Option[Boolean] = None, source: Option[String] = None, trackHits: Option[Boolean] = None, allowPartialSearchResults: Option[Boolean] = None, batchedReduceSize: Option[Int] = None, typedKeys: Option[Boolean] = None) extends Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SearchRequest
  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 SearchRequest(indexes: Indexes, aggs: Seq[AbstractAggregation] = Nil, collapse: Option[CollapseRequest] = None, docValues: Seq[String] = Nil, scriptFields: Seq[ScriptField] = Nil, storedFields: Seq[String] = Nil, fetchContext: Option[FetchSourceContext] = None, pref: Option[String] = None, routing: Option[String] = None, terminateAfter: Option[Int] = None, timeout: Option[Duration] = None, minScore: Option[Double] = None, rescorers: Seq[Rescore] = Nil, trackScores: Option[Boolean] = None, indicesOptions: Option[IndicesOptionsRequest] = None, inners: Seq[InnerHit] = Nil, indexBoosts: Seq[(String, Double)] = Nil, keepAlive: Option[String] = None, highlight: Option[Highlight] = None, query: Option[Query] = None, postFilter: Option[Query] = None, requestCache: Option[Boolean] = None, sorts: Seq[Sort] = Nil, suggs: Seq[Suggestion] = Nil, globalSuggestionText: Option[String] = None, from: Option[Int] = None, size: Option[Int] = None, slice: Option[(Int, Int)] = None, explain: Option[Boolean] = None, stats: Seq[String] = Nil, searchType: Option[SearchType] = None, searchAfter: Seq[Any] = Nil, version: Option[Boolean] = None, profile: Option[Boolean] = None, source: Option[String] = None, trackHits: Option[Boolean] = None, allowPartialSearchResults: Option[Boolean] = None, batchedReduceSize: Option[Int] = None, typedKeys: 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: AbstractAggregation, rest: AbstractAggregation*): SearchRequest

    Permalink
  5. def aggregations(aggs: Iterable[AbstractAggregation]): SearchRequest

    Permalink
  6. def aggs(iterable: Iterable[AbstractAggregation]): SearchRequest

    Permalink
  7. def aggs(first: AbstractAggregation, rest: AbstractAggregation*): SearchRequest

    Permalink
  8. val aggs: Seq[AbstractAggregation]

    Permalink
  9. val allowPartialSearchResults: Option[Boolean]

    Permalink
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. val batchedReduceSize: Option[Int]

    Permalink
  12. def bool(block: ⇒ BoolQuery): SearchRequest

    Permalink
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def collapse(collapse: CollapseRequest): SearchRequest

    Permalink
  15. val collapse: Option[CollapseRequest]

    Permalink
  16. def docValues(_fields: Seq[String]): SearchRequest

    Permalink
  17. def docValues(first: String, rest: String*): SearchRequest

    Permalink
  18. val docValues: Seq[String]

    Permalink
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def explain(enabled: Boolean): SearchRequest

    Permalink
  21. val explain: Option[Boolean]

    Permalink
  22. def fetchContext(context: FetchSourceContext): SearchRequest

    Permalink
  23. val fetchContext: Option[FetchSourceContext]

    Permalink
  24. def fetchSource(fetch: Boolean): SearchRequest

    Permalink
  25. def finalize(): Unit

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

    Permalink
  27. val from: Option[Int]

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

    Permalink
    Definition Classes
    AnyRef → Any
  29. def globalSuggestionText(text: String): SearchRequest

    Permalink
  30. val globalSuggestionText: Option[String]

    Permalink
  31. val highlight: Option[Highlight]

    Permalink
  32. def highlighting(options: HighlightOptions, fields: Iterable[HighlightField]): SearchRequest

    Permalink
  33. def highlighting(options: HighlightOptions, first: HighlightField, rest: HighlightField*): SearchRequest

    Permalink
  34. def highlighting(fields: Iterable[HighlightField]): SearchRequest

    Permalink
  35. def highlighting(first: HighlightField, rest: HighlightField*): SearchRequest

    Permalink
  36. def indexBoost(tuples: (String, Double)*): SearchRequest

    Permalink
  37. def indexBoost(map: Map[String, Double]): SearchRequest

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

    Permalink
  39. val indexes: Indexes

    Permalink
  40. def indicesOptions(options: IndicesOptionsRequest): SearchRequest

    Permalink
  41. val indicesOptions: Option[IndicesOptionsRequest]

    Permalink
  42. def inner(inners: Iterable[InnerHit]): SearchRequest

    Permalink
  43. def inner(first: InnerHit, rest: InnerHit*): SearchRequest

    Permalink
  44. val inners: Seq[InnerHit]

    Permalink
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. def keepAlive(duration: FiniteDuration): SearchRequest

    Permalink
  47. def keepAlive(keepAlive: String): SearchRequest

    Permalink
  48. val keepAlive: Option[String]

    Permalink
  49. def limit(i: Int): SearchRequest

    Permalink
  50. def matchAllQuery(): SearchRequest

    Permalink
  51. def matchQuery(field: String, value: Any): SearchRequest

    Permalink
  52. def minScore(min: Double): SearchRequest

    Permalink
  53. val minScore: Option[Double]

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

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

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

    Permalink
    Definition Classes
    AnyRef
  57. def postFilter(block: ⇒ Query): SearchRequest

    Permalink
  58. val postFilter: Option[Query]

    Permalink
  59. val pref: Option[String]

    Permalink
  60. def preference(pref: String): SearchRequest

    Permalink
  61. def preference(pref: Preference): SearchRequest

    Permalink
  62. def prefix(name: String, value: Any): SearchRequest

    Permalink
  63. val profile: Option[Boolean]

    Permalink
  64. def query(q: Query): SearchRequest

    Permalink
  65. def query(string: String): SearchRequest

    Permalink

    Adds a single string query to this search

    Adds a single string query to this search

    string

    the query string

  66. val query: Option[Query]

    Permalink
  67. def rawQuery(json: String): SearchRequest

    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 "*" limit 5 rawQuery {
    """{ "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } }"""
    } searchType SearchType.Scan
  68. def regexQuery(field: String, value: String): SearchRequest

    Permalink
  69. def regexQuery(tuple: (String, String)): SearchRequest

    Permalink
  70. def requestCache(requestCache: Boolean): SearchRequest

    Permalink
  71. val requestCache: Option[Boolean]

    Permalink
  72. def rescore(rescorers: Iterable[Rescore]): SearchRequest

    Permalink
  73. def rescore(first: Rescore, rest: Rescore*): SearchRequest

    Permalink
  74. val rescorers: Seq[Rescore]

    Permalink
  75. def routing(r: String): SearchRequest

    Permalink
  76. val routing: Option[String]

    Permalink
  77. val scriptFields: Seq[ScriptField]

    Permalink
  78. def scriptfields(_fields: Iterable[ScriptField]): SearchRequest

    Permalink
  79. def scriptfields(fields: ScriptField*): SearchRequest

    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 ScriptField instances

    returns

    this, an instance of SearchRequest

  80. def scroll(duration: FiniteDuration): SearchRequest

    Permalink
  81. def scroll(keepAlive: String): SearchRequest

    Permalink
  82. def searchAfter(values: Seq[Any]): SearchRequest

    Permalink
  83. val searchAfter: Seq[Any]

    Permalink
  84. def searchType(searchType: SearchType): SearchRequest

    Permalink
  85. val searchType: Option[SearchType]

    Permalink
  86. def size(i: Int): SearchRequest

    Permalink
  87. val size: Option[Int]

    Permalink
  88. def slice(id: Int, max: Int): SearchRequest

    Permalink
  89. val slice: Option[(Int, Int)]

    Permalink
  90. def sortBy(sorts: Iterable[Sort]): SearchRequest

    Permalink
  91. def sortBy(sorts: Sort*): SearchRequest

    Permalink
  92. def sortByFieldAsc(name: String): SearchRequest

    Permalink
  93. def sortByFieldDesc(name: String): SearchRequest

    Permalink
  94. val sorts: Seq[Sort]

    Permalink
  95. def source(json: String): SearchRequest

    Permalink

    Sets the source of the request as a json string.

    Sets the source of the request as a json string. Note, if you use this method any other body-level settings will be ignored.

    HTTP query-parameter settings can still be used, eg limit, routing, search type etc.

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

    NOTE: This method only works with the HTTP client.

    Example:

    search in "*" limit 5 source {
    """{ "query": { "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } } }"""
    } searchType SearchType.Scan
  96. val source: Option[String]

    Permalink
  97. def sourceExclude(excludes: Iterable[String]): SearchRequest

    Permalink
  98. def sourceExclude(first: String, rest: String*): SearchRequest

    Permalink
  99. def sourceFiltering(includes: Iterable[String], excludes: Iterable[String]): SearchRequest

    Permalink
  100. def sourceInclude(includes: Iterable[String]): SearchRequest

    Permalink
  101. def sourceInclude(first: String, rest: String*): SearchRequest

    Permalink
  102. def start(i: Int): SearchRequest

    Permalink
  103. def stats(groups: String*): SearchRequest

    Permalink
  104. val stats: Seq[String]

    Permalink
  105. def storedFields(_fields: Iterable[String]): SearchRequest

    Permalink
  106. def storedFields(first: String, rest: String*): SearchRequest

    Permalink
  107. val storedFields: Seq[String]

    Permalink
  108. def suggestion(sugg: Suggestion): SearchRequest

    Permalink
  109. def suggestions(suggs: Iterable[Suggestion]): SearchRequest

    Permalink
  110. def suggestions(first: Suggestion, rest: Suggestion*): SearchRequest

    Permalink

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

  111. val suggs: Seq[Suggestion]

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

    Permalink
    Definition Classes
    AnyRef
  113. def termQuery(field: String, value: Any): SearchRequest

    Permalink
  114. def termQuery(tuple: (String, Any)): SearchRequest

    Permalink
  115. def terminateAfter(terminateAfter: Int): SearchRequest

    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.

  116. val terminateAfter: Option[Int]

    Permalink
  117. def timeout(timeout: FiniteDuration): SearchRequest

    Permalink
  118. val timeout: Option[Duration]

    Permalink
  119. val trackHits: Option[Boolean]

    Permalink
  120. def trackScores(enabled: Boolean): SearchRequest

    Permalink
  121. val trackScores: Option[Boolean]

    Permalink
  122. def trackTotalHits(value: Boolean): SearchRequest

    Permalink
  123. def typedKeys(enabled: Boolean): SearchRequest

    Permalink
  124. val typedKeys: Option[Boolean]

    Permalink
  125. def version(version: Boolean): SearchRequest

    Permalink
  126. val version: Option[Boolean]

    Permalink
  127. final def wait(): Unit

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

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

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

Deprecated Value Members

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

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) Renamed to storedFields

  2. def matchAll(): SearchRequest

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.2.0) Use matchAllQuery()

  3. def regex(tuple: (String, String)): SearchRequest

    Permalink
    Annotations
    @deprecated
    Deprecated

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

  4. def sort(sorts: Sort*): SearchRequest

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use sortBy

  5. def term(field: String, value: Any): SearchRequest

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 5.0.0) use termQuery()

  6. def term(tuple: (String, Any)): SearchRequest

    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