Index Repository
class IndexRepository<T : Any>(val indexName: String, client: SearchClient, val serializer: ModelSerializationStrategy<T>, val indexWriteAlias: String = indexName, val indexReadAlias: String = indexWriteAlias, val defaultParameters: Map<String, String>? = null, defaultRefresh: Refresh? = Refresh.WaitFor, defaultTimeout: Duration? = null, logging: Boolean = true)
Constructors
Link copied to clipboard
constructor(indexName: String, client: SearchClient, serializer: ModelSerializationStrategy<T>, indexWriteAlias: String = indexName, indexReadAlias: String = indexWriteAlias, defaultParameters: Map<String, String>? = null, defaultRefresh: Refresh? = Refresh.WaitFor, defaultTimeout: Duration? = null, logging: Boolean = true)
Properties
Functions
Link copied to clipboard
suspend fun bulk(bulkSize: Int = 100, pipeline: String? = null, refresh: Refresh? = Refresh.WaitFor, routing: String? = null, timeout: Duration? = null, waitForActiveShards: String? = null, requireAlias: Boolean? = null, source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, failOnFirstError: Boolean = false, callBack: BulkItemCallBack? = null, maxRetries: Int = 2, retryDelay: Duration = 2.seconds, retryTimeout: Duration = 1.minutes, block: suspend TypedDocumentIBulkSession<T>.() -> Unit)
Link copied to clipboard
suspend fun createIndex(mappingsAndSettings: IndexSettingsAndMappingsDSL, waitForActiveShards: Int? = null, masterTimeOut: Duration? = null, timeout: Duration? = null, extraParameters: Map<String, String>? = null): IndexCreateResponse
suspend fun createIndex(waitForActiveShards: Int? = null, masterTimeOut: Duration? = null, timeout: Duration? = null, extraParameters: Map<String, String>? = null, block: IndexSettingsAndMappingsDSL.() -> Unit): IndexCreateResponse
Link copied to clipboard
suspend fun delete(id: String, ifSeqNo: Int? = null, ifPrimaryTerm: Int? = null, refresh: Refresh? = null, routing: String? = null, timeout: Duration? = null, version: Long? = null, versionType: VersionType? = null, waitForActiveShards: String? = null, extraParameters: Map<String, String>? = null): DocumentIndexResponse
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun get(id: String, preference: String? = null, realtime: Boolean? = null, refresh: Refresh? = null, routing: String? = null, storedFields: String? = null, source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, version: Long? = null, versionType: VersionType? = null, extraParameters: Map<String, String>? = null): Pair<T, GetDocumentResponse>
Link copied to clipboard
More user friendly version of get that returns either the document or null.
Link copied to clipboard
suspend fun index(value: T, id: String? = null, ifSeqNo: Int? = null, ifPrimaryTerm: Int? = null, opType: OperationType? = null, pipeline: String? = null, refresh: Refresh? = null, routing: String? = null, timeout: Duration? = null, version: Long? = null, versionType: VersionType? = null, waitForActiveShards: String? = null, requireAlias: Boolean? = null, extraParameters: Map<String, String>? = null): DocumentIndexResponse
Link copied to clipboard
suspend fun mGet(vararg docIds: String, preference: String? = null, realtime: Boolean? = null, refresh: Refresh? = null, routing: String? = null, storedFields: String? = null, source: String? = null): MGetResponse
suspend fun mGet(preference: String? = null, realtime: Boolean? = null, refresh: Refresh? = null, routing: String? = null, storedFields: String? = null, source: String? = null, block: MGetRequest.() -> Unit): MGetResponse
Link copied to clipboard
Link copied to clipboard
suspend fun search(dsl: SearchDSL, allowNoIndices: Boolean? = null, allowPartialSearchResults: Boolean? = null, analyzer: String? = null, analyzeWildcard: Boolean? = null, batchedReduceSize: Int? = null, ccsMinimizeRoundtrips: Boolean? = null, defaultOperator: SearchOperator? = null, df: String? = null, docvalueFields: String? = null, expandWildcards: ExpandWildCards? = null, explain: Boolean? = null, from: Int? = null, ignoreThrottled: Boolean? = null, ignoreUnavailable: Boolean? = null, lenient: Boolean? = null, maxConcurrentShardRequests: Int? = null, preFilterShardSize: Int? = null, preference: String? = null, q: String? = null, requestCache: Boolean? = null, restTotalHitsAsInt: Boolean? = null, routing: String? = null, scroll: String? = null, searchType: SearchType? = null, seqNoPrimaryTerm: Boolean? = null, size: Int? = null, sort: String? = null, _source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, stats: String? = null, storedFields: String? = null, suggestField: String? = null, suggestMode: SuggestMode? = null, suggestSize: Int? = null, suggestText: String? = null, terminateAfter: Int? = null, timeout: Duration? = null, trackScores: Boolean? = null, trackTotalHits: Boolean? = null, typedKeys: Boolean? = null, version: Boolean? = null, extraParameters: Map<String, String>? = null): SearchResponse
suspend fun search(allowNoIndices: Boolean? = null, allowPartialSearchResults: Boolean? = null, analyzer: String? = null, analyzeWildcard: Boolean? = null, batchedReduceSize: Int? = null, ccsMinimizeRoundtrips: Boolean? = null, defaultOperator: SearchOperator? = null, df: String? = null, docvalueFields: String? = null, expandWildcards: ExpandWildCards? = null, explain: Boolean? = null, from: Int? = null, ignoreThrottled: Boolean? = null, ignoreUnavailable: Boolean? = null, lenient: Boolean? = null, maxConcurrentShardRequests: Int? = null, preFilterShardSize: Int? = null, preference: String? = null, q: String? = null, requestCache: Boolean? = null, restTotalHitsAsInt: Boolean? = null, routing: String? = null, scroll: String? = null, searchType: SearchType? = null, seqNoPrimaryTerm: Boolean? = null, size: Int? = null, sort: String? = null, _source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, stats: String? = null, storedFields: String? = null, suggestField: String? = null, suggestMode: SuggestMode? = null, suggestSize: Int? = null, suggestText: String? = null, terminateAfter: Int? = null, timeout: Duration? = null, trackScores: Boolean? = null, trackTotalHits: Boolean? = null, typedKeys: Boolean? = null, version: Boolean? = null, extraParameters: Map<String, String>? = null, block: SearchDSL.() -> Unit): SearchResponse
suspend fun search(rawJson: String, allowNoIndices: Boolean? = null, allowPartialSearchResults: Boolean? = null, analyzer: String? = null, analyzeWildcard: Boolean? = null, batchedReduceSize: Int? = null, ccsMinimizeRoundtrips: Boolean? = null, defaultOperator: SearchOperator? = null, df: String? = null, docvalueFields: String? = null, expandWildcards: ExpandWildCards? = null, explain: Boolean? = null, from: Int? = null, ignoreThrottled: Boolean? = null, ignoreUnavailable: Boolean? = null, lenient: Boolean? = null, maxConcurrentShardRequests: Int? = null, preFilterShardSize: Int? = null, preference: String? = null, q: String? = null, requestCache: Boolean? = null, restTotalHitsAsInt: Boolean? = null, routing: String? = null, scroll: String? = null, searchType: SearchType? = null, seqNoPrimaryTerm: Boolean? = null, size: Int? = null, sort: String? = null, _source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, stats: String? = null, storedFields: String? = null, suggestField: String? = null, suggestMode: SuggestMode? = null, suggestSize: Int? = null, suggestText: String? = null, terminateAfter: Int? = null, timeout: Duration? = null, trackScores: Boolean? = null, trackTotalHits: Boolean? = null, typedKeys: Boolean? = null, version: Boolean? = null, extraParameters: Map<String, String>? = null, retries: Int = 3, retryDelay: Duration = 2.seconds): SearchResponse
Link copied to clipboard
suspend fun searchAfter(keepAlive: Duration = 1.minutes, optInToCustomSort: Boolean = false, block: SearchDSL.() -> Unit): Pair<SearchResponse, Flow<SearchResponse.Hit>>
Link copied to clipboard
suspend fun searchDocuments(allowNoIndices: Boolean? = null, allowPartialSearchResults: Boolean? = null, analyzer: String? = null, analyzeWildcard: Boolean? = null, batchedReduceSize: Int? = null, ccsMinimizeRoundtrips: Boolean? = null, defaultOperator: SearchOperator? = null, df: String? = null, docvalueFields: String? = null, expandWildcards: ExpandWildCards? = null, explain: Boolean? = null, from: Int? = null, ignoreThrottled: Boolean? = null, ignoreUnavailable: Boolean? = null, lenient: Boolean? = null, maxConcurrentShardRequests: Int? = null, preFilterShardSize: Int? = null, preference: String? = null, q: String? = null, requestCache: Boolean? = null, restTotalHitsAsInt: Boolean? = null, routing: String? = null, scroll: String? = null, searchType: SearchType? = null, seqNoPrimaryTerm: Boolean? = null, size: Int? = null, sort: String? = null, _source: String? = null, sourceExcludes: String? = null, sourceIncludes: String? = null, stats: String? = null, storedFields: String? = null, suggestField: String? = null, suggestMode: SuggestMode? = null, suggestSize: Int? = null, suggestText: String? = null, terminateAfter: Int? = null, timeout: Duration? = null, trackScores: Boolean? = null, trackTotalHits: Boolean? = null, typedKeys: Boolean? = null, version: Boolean? = null, extraParameters: Map<String, String>? = null, block: SearchDSL.() -> Unit): List<T>
More user friendly way to search documents that simply returns a list of documents.