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, seqNoPrimaryTerm: Option[Boolean] = None, profile: Option[Boolean] = None, source: Option[String] = None, trackHits: Option[Any] = None, allowPartialSearchResults: Option[Boolean] = None, batchedReduceSize: Option[Int] = None, typedKeys: Option[Boolean] = None, runtimeMappings: Seq[RuntimeMapping] = Nil, ext: Map[String, Any] = Map.empty, knn: Option[Knn] = None, multipleKnn: Seq[Knn] = Nil, pit: Option[Pit] = None) extends Product with Serializable
- Alphabetic
- By Inheritance
- SearchRequest
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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, seqNoPrimaryTerm: Option[Boolean] = None, profile: Option[Boolean] = None, source: Option[String] = None, trackHits: Option[Any] = None, allowPartialSearchResults: Option[Boolean] = None, batchedReduceSize: Option[Int] = None, typedKeys: Option[Boolean] = None, runtimeMappings: Seq[RuntimeMapping] = Nil, ext: Map[String, Any] = Map.empty, knn: Option[Knn] = None, multipleKnn: Seq[Knn] = Nil, pit: Option[Pit] = None)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def aggregations(first: AbstractAggregation, rest: AbstractAggregation*): SearchRequest
- def aggregations(aggs: Iterable[AbstractAggregation]): SearchRequest
- def aggs(iterable: Iterable[AbstractAggregation]): SearchRequest
- def aggs(first: AbstractAggregation, rest: AbstractAggregation*): SearchRequest
- val aggs: Seq[AbstractAggregation]
- val allowPartialSearchResults: Option[Boolean]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val batchedReduceSize: Option[Int]
- def bool(block: => BoolQuery): SearchRequest
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def collapse(collapse: CollapseRequest): SearchRequest
- val collapse: Option[CollapseRequest]
- def docValues(_fields: Seq[String]): SearchRequest
- def docValues(first: String, rest: String*): SearchRequest
- val docValues: Seq[String]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def explain(enabled: Boolean): SearchRequest
- val explain: Option[Boolean]
- def ext(ext: Map[String, Any]): SearchRequest
- val ext: Map[String, Any]
- def fetchContext(context: FetchSourceContext): SearchRequest
- val fetchContext: Option[FetchSourceContext]
- def fetchSource(fetch: Boolean): SearchRequest
- def from(i: Int): SearchRequest
- val from: Option[Int]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def globalSuggestionText(text: String): SearchRequest
- val globalSuggestionText: Option[String]
- val highlight: Option[Highlight]
- def highlighting(options: HighlightOptions, fields: Iterable[HighlightField]): SearchRequest
- def highlighting(options: HighlightOptions, first: HighlightField, rest: HighlightField*): SearchRequest
- def highlighting(fields: Iterable[HighlightField]): SearchRequest
- def highlighting(first: HighlightField, rest: HighlightField*): SearchRequest
- def indexBoost(tuples: (String, Double)*): SearchRequest
- def indexBoost(map: Map[String, Double]): SearchRequest
- val indexBoosts: Seq[(String, Double)]
- val indexes: Indexes
- def indicesOptions(options: IndicesOptionsRequest): SearchRequest
- val indicesOptions: Option[IndicesOptionsRequest]
- def inner(inners: Iterable[InnerHit]): SearchRequest
- def inner(first: InnerHit, rest: InnerHit*): SearchRequest
- val inners: Seq[InnerHit]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keepAlive(duration: FiniteDuration): SearchRequest
- def keepAlive(keepAlive: String): SearchRequest
- val keepAlive: Option[String]
- def knn(knn: Knn): SearchRequest
- val knn: Option[Knn]
- def limit(i: Int): SearchRequest
- def matchAllQuery(): SearchRequest
- def matchQuery(field: String, value: Any): SearchRequest
- def minScore(min: Double): SearchRequest
- val minScore: Option[Double]
- def multipleKnn(multipleKnn: Iterable[Knn]): SearchRequest
- val multipleKnn: Seq[Knn]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def pit(pit: Pit): SearchRequest
- val pit: Option[Pit]
- def postFilter(block: => Query): SearchRequest
- val postFilter: Option[Query]
- val pref: Option[String]
- def preference(pref: String): SearchRequest
- def preference(pref: Preference): SearchRequest
- def prefix(name: String, value: Any): SearchRequest
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val profile: Option[Boolean]
- def query(q: Query): SearchRequest
- def query(string: String): SearchRequest
Adds a single string query to this search
Adds a single string query to this search
- string
the query string
- val query: Option[Query]
- def rawQuery(json: String): SearchRequest
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
- def regexQuery(field: String, value: String): SearchRequest
- def regexQuery(tuple: (String, String)): SearchRequest
- def requestCache(requestCache: Boolean): SearchRequest
- val requestCache: Option[Boolean]
- def rescore(rescorers: Iterable[Rescore]): SearchRequest
- def rescore(first: Rescore, rest: Rescore*): SearchRequest
- val rescorers: Seq[Rescore]
- def routing(r: String): SearchRequest
- val routing: Option[String]
- def runtimeMappings(mappings: Iterable[RuntimeMapping]): SearchRequest
- def runtimeMappings(mappings: RuntimeMapping*): SearchRequest
- val runtimeMappings: Seq[RuntimeMapping]
- val scriptFields: Seq[ScriptField]
- def scriptfields(_fields: Iterable[ScriptField]): SearchRequest
- def scriptfields(fields: ScriptField*): SearchRequest
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
- def scroll(duration: FiniteDuration): SearchRequest
- def scroll(keepAlive: String): SearchRequest
- def searchAfter(values: Seq[Any]): SearchRequest
- val searchAfter: Seq[Any]
- def searchType(searchType: SearchType): SearchRequest
- val searchType: Option[SearchType]
- def seqNoPrimaryTerm(seqNoPrimaryTerm: Boolean): SearchRequest
- val seqNoPrimaryTerm: Option[Boolean]
- def size(i: Int): SearchRequest
- val size: Option[Int]
- def slice(id: Int, max: Int): SearchRequest
- val slice: Option[(Int, Int)]
- def sortBy(sorts: Iterable[Sort]): SearchRequest
- def sortBy(sorts: Sort*): SearchRequest
- def sortByFieldAsc(name: String): SearchRequest
- def sortByFieldDesc(name: String): SearchRequest
- val sorts: Seq[Sort]
- def source(json: String): SearchRequest
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
- val source: Option[String]
- def sourceExclude(excludes: Iterable[String]): SearchRequest
- def sourceExclude(first: String, rest: String*): SearchRequest
- def sourceFiltering(includes: Iterable[String], excludes: Iterable[String]): SearchRequest
- def sourceInclude(includes: Iterable[String]): SearchRequest
- def sourceInclude(first: String, rest: String*): SearchRequest
- def start(i: Int): SearchRequest
- def stats(groups: String*): SearchRequest
- val stats: Seq[String]
- def storedFields(_fields: Iterable[String]): SearchRequest
- def storedFields(first: String, rest: String*): SearchRequest
- val storedFields: Seq[String]
- def suggestion(sugg: Suggestion): SearchRequest
- def suggestions(suggs: Iterable[Suggestion]): SearchRequest
- def suggestions(first: Suggestion, rest: Suggestion*): SearchRequest
Adds a new suggestion to the search request, which can be looked up in the response using the name provided.
- val suggs: Seq[Suggestion]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def termQuery(field: String, value: Any): SearchRequest
- def termQuery(tuple: (String, Any)): SearchRequest
- def terminateAfter(terminateAfter: Int): SearchRequest
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.
- val terminateAfter: Option[Int]
- def timeout(timeout: FiniteDuration): SearchRequest
- val timeout: Option[Duration]
- val trackHits: Option[Any]
- def trackScores(enabled: Boolean): SearchRequest
- val trackScores: Option[Boolean]
- def trackTotalHits(value: Long): SearchRequest
- def trackTotalHits(value: Boolean): SearchRequest
- def typedKeys(enabled: Boolean): SearchRequest
- val typedKeys: Option[Boolean]
- def version(version: Boolean): SearchRequest
- val version: Option[Boolean]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)