Search Client
Search client that you can use to talk to Elasticsearch or Opensearch.
Most client api functions are implemented as extension functions.
Parameters
rest client configured to talk to your search engine. Defaults to KtorRestClient configured to talk to localhost:9200.
kotlinx.serialization Json used to deserialize responses. Defaults to DEFAULT_JSON which is configured with some sane defaults.
Functions
Send a single bulk request. Consider using the variant that creates a BulkSession.
Creates a bulk session that allows you to index, create, or delete items via the convenient kotlin DSL.
Variant of the _count api that allows you to pass in an ESQuery object. It will be set as the query on the json body that is sent to _count.
Variant of the _count api that takes a search dsl block so you can set the query. Note, not all parts of the search dsl are supported by _count. E.g. adding sorting would be an error.
Variant of the _count api that takes an optional rawBody. Leaving the body empty means doing a match_all search.
Create a point in time for use with e.g. search_after.
Delete a scroll by id.
Cheap way to access the version information returned by root
Returns the aliases for a target.
Returns the set of alias names for an index or an empty set.
Returns the set of indices that have the alias. If you call this on an index, the returned set will just contain the index.
Reindex and waits for completion. Returns a reindex response indicating what was reindexed.
Reindexes using a background task in ES and polls for that task to complete every pollInterval for a maximum of timeout. Note: the same timeout is passed on to the reindex task
Reindexes using a background task in ES. Returns a TaskId response with an id that you can use with the task api.
Http GET to /
Scroll through search results for a scrolling search.
Perform a deep paging search using point in time and search after.
Atomically process alias updates with a DSL.