SearchQuery

open class SearchQuery<S : BaseDocSource>(docSourceFactory: (<ERROR CLASS>) -> S, query: QueryExpression?, params: Params) : BaseSearchQuery<S, SearchQuery<S>>

An asynchronous version of search query.

Constructors

SearchQuery
Link copied to clipboard
fun <S : BaseDocSource> SearchQuery(docSourceFactory: (<ERROR CLASS>) -> S, query: QueryExpression? = null, params: Params = Params())

Types

CLEAR
Link copied to clipboard
object CLEAR
Companion
Link copied to clipboard
object Companion

Functions

aggs
Link copied to clipboard
fun aggs(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears the existing aggregations.
fun aggs(vararg aggregations: <ERROR CLASS><String, Aggregation<*>>): SearchQuery<S>
Adds aggregations to the existing query aggregations.
fun aggs(aggregations: Map<String, Aggregation<*>>): SearchQuery<S>
Adds aggregations to the existing query aggregations.
clone
Link copied to clipboard
fun clone(): SearchQuery<S>
Clones this search query builder.
docvalueFields
Link copied to clipboard
fun docvalueFields(clear: SearchQuery.CLEAR): SearchQuery<S>
fun docvalueFields(vararg fields: FieldFormat): SearchQuery<S>
execute
Link copied to clipboard
suspend fun execute(index: ElasticsearchIndex): SearchQueryResult<S>
ext
Link copied to clipboard
fun ext(clear: SearchQuery.CLEAR): SearchQuery<S>
fun ext(vararg extensions: SearchExt): SearchQuery<S>
fields
Link copied to clipboard
fun fields(clear: SearchQuery.CLEAR): SearchQuery<S>
fun fields(vararg fields: FieldFormat): SearchQuery<S>
filter
Link copied to clipboard
fun filter(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears the existing filters.
fun filter(vararg filters: QueryExpression): SearchQuery<S>
Combines all the filter expressions together and wraps the existing query using the dev.evo.elasticmagic.query.Bool query expression.
from
Link copied to clipboard
fun from(from: Int?): SearchQuery<S>
postFilter
Link copied to clipboard
fun postFilter(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears the existing post filters.
fun postFilter(vararg filters: QueryExpression): SearchQuery<S>
Filter expressions in the post filter will be applied after the aggregations are calculated.
prepare
Link copied to clipboard
fun prepare(): PreparedSearchQuery<S>
Makes an immutable view of the search query.
query
Link copied to clipboard
fun query(query: QueryExpression?): SearchQuery<S>
Replaces main query expression.
queryNode
Link copied to clipboard
inline fun <N : QueryExpressionNode<N>> queryNode(handle: NodeHandle<N>, block: (N) -> Unit): SearchQuery<S>
Allows modifying specific query expression node using handle of the node.
requestCache
Link copied to clipboard
fun requestCache(requestCache: Boolean?): SearchQuery<S>
rescore
Link copied to clipboard
fun rescore(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears the existing rescorers.
fun rescore(vararg rescores: Rescore): SearchQuery<S>
Adds rescores to the existing query rescorers.
routing
Link copied to clipboard
fun routing(routing: Long?): SearchQuery<S>
fun routing(routing: String?): SearchQuery<S>
scriptFields
Link copied to clipboard
fun scriptFields(clear: SearchQuery.CLEAR): SearchQuery<S>
fun scriptFields(vararg fields: <ERROR CLASS><String, Script>): SearchQuery<S>
searchParams
Link copied to clipboard
fun searchParams(vararg params: <ERROR CLASS><String, Any?>): SearchQuery<S>
searchType
Link copied to clipboard
fun searchType(searchType: SearchType?): SearchQuery<S>
seqNoPrimaryTerm
Link copied to clipboard
fun seqNoPrimaryTerm(seqNoPrimaryTerm: Boolean?): SearchQuery<S>
size
Link copied to clipboard
fun size(size: Int?): SearchQuery<S>
sort
Link copied to clipboard
fun sort(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears the existing sorts.
fun sort(vararg sorts: Sort): SearchQuery<S>
Adds sorts to the existing query sorting expressions.
fun sort(sorts: List<Sort>): SearchQuery<S>
Adds sorts from a list to the existing query sorting expressions.
source
Link copied to clipboard
fun source(clear: SearchQuery.CLEAR): SearchQuery<S>
Clears source filtering values that were previously set.
fun source(vararg includes: FieldOperations<*>): SearchQuery<S>
Adds includes field lists to the document source fields filtering.
fun source(enable: Boolean): SearchQuery<S>
Disables or enables document's source filtering.
fun source(includes: List<FieldOperations<*>> = emptyList(), excludes: List<FieldOperations<*>> = emptyList()): SearchQuery<S>
Adds includes and excludes field lists to the document source fields filtering.
stats
Link copied to clipboard
fun stats(stats: String?): SearchQuery<S>
storedFields
Link copied to clipboard
fun storedFields(clear: SearchQuery.CLEAR): SearchQuery<S>
fun storedFields(vararg fields: FieldOperations<*>): SearchQuery<S>
terminateAfter
Link copied to clipboard
fun terminateAfter(terminateAfter: Int?): SearchQuery<S>
trackScores
Link copied to clipboard
fun trackScores(trackScores: Boolean?): SearchQuery<S>
If trackScores is true forces computing scores even when sorting on a field.
trackTotalHits
Link copied to clipboard
fun trackTotalHits(trackTotalHits: Boolean?): SearchQuery<S>
When trackTotalHits is true the search query will always count the total number of hits that match the query.
version
Link copied to clipboard
fun version(version: Boolean?): SearchQuery<S>