An OpenSearch client: documents, bulk, the query DSL, aggregations, scroll and point in time, index admin, SQL and PPL, k-NN vector search, ISM, security and AWS signing.
Functions
func CreateIndex (c: Client, name: str , body: str ): bool Creates an index with a settings and mappings body; an empty body uses the defaults.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func CreateIndexWith (c: Client, name: str , shards: int , replicas: int , properties: str ): bool Creates an index from shard and replica counts and the mapping properties; 0 shards or -1 replicas leaves that setting out.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteIndex (c: Client, name: str ): bool Deletes an index; a list or pattern works too.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteIndexIfExists (c: Client, name: str ): bool Deletes an index and is true also when it did not exist.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func IndexExists (c: Client, name: str ): bool The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetIndex (c: Client, name: str ): str The settings, mappings and aliases of an index, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetMapping (c: Client, index: str ): str The mappings as raw JSON; an empty index means all.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutMapping (c: Client, index: str , properties: str ): bool Adds fields to the mapping, given as the members of properties.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutMappingBody (c: Client, index: str , body: str ): bool Changes the mapping with a full body.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetSettings (c: Client, index: str ): str The settings as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetSetting (c: Client, index: str , name: str ): str One setting of an index, such as index.refresh_interval.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutSettings (c: Client, index: str , settings: str ): bool The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Refresh (c: Client, index: str ): bool Makes recent writes searchable.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Flush (c: Client, index: str ): bool Writes the transaction log to disk.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func ForceMerge (c: Client, index: str , max_segments: int ): bool Merges segments, down to the given count when it is above 0.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func ClearCache (c: Client, index: str ): bool Clears the caches of an index.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func OpenIndex (c: Client, index: str ): bool The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func CloseIndex (c: Client, index: str ): bool Closes an index; it keeps its data but takes no reads or writes.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func CloneIndex (c: Client, source: str , target: str , body: str ): bool Copies an index whose writes are blocked into a new index.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func ShrinkIndex (c: Client, source: str , target: str , body: str ): bool Copies an index into one with fewer shards.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func SplitIndex (c: Client, source: str , target: str , body: str ): bool Copies an index into one with more shards.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func IndexStats (c: Client, index: str ): str Statistics of an index as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutAlias (c: Client, index: str , alias: str ): bool Points an alias at an index.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutAliasFiltered (c: Client, index: str , alias: str , filter: str , is_write_index: bool ): bool Points an alias at an index with a filter, and optionally makes it the write index.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteAlias (c: Client, index: str , alias: str ): bool Removes an alias from an index.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func AliasExists (c: Client, alias: str ): bool The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetAliases (c: Client, index: str ): str The aliases of an index, or all, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func AliasIndices (c: Client, alias: str ): Vector < str > The indices an alias points at.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func AliasAction (action: str , index: str , alias: str ): str One add or remove action for UpdateAliases.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func UpdateAliases (c: Client, actions: Vector < str >): bool Applies several alias actions in one atomic step.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func SwapAlias (c: Client, alias: str , old_index: str , new_index: str ): bool Moves an alias from one index to another in one atomic step; the way to rebuild an index with no downtime.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutIndexTemplate (c: Client, name: str , body: str ): bool Creates or replaces an index template.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func IndexTemplate (patterns: Vector < str >, settings: str , properties: str , priority: int ): str An index template body from patterns, settings, mapping properties and a priority.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetIndexTemplate (c: Client, name: str ): str An index template as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func IndexTemplateExists (c: Client, name: str ): bool The index template exists.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteIndexTemplate (c: Client, name: str ): bool Deletes an index template.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PutComponentTemplate (c: Client, name: str , body: str ): bool Creates or replaces a component template.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func GetComponentTemplate (c: Client, name: str ): str A component template as raw JSON.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteComponentTemplate (c: Client, name: str ): bool Deletes a component template.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func CreateDataStream (c: Client, name: str ): bool Creates a data stream; a matching index template with data_stream must exist.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DeleteDataStream (c: Client, name: str ): bool Deletes a data stream and its backing indices.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func DataStreams (c: Client): Vector < str > The names of all data streams.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Rollover (c: Client, alias: str , conditions: str ): str Rolls an alias or data stream over to a new index, optionally only when conditions hold; returns the new index name.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Analyze (c: Client, index: str , analyzer: str , text: str ): Vector < str > The tokens an analyzer makes of a text; an empty analyzer means standard.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func CatIndices (c: Client, pattern: str ): Vector <IndexInfo> One row per index, sorted by name; an empty pattern means all.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Property (name: str , kind: str ): str One mapping field, "name":{"type":kind}, for Properties.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func PropertyWith (name: str , kind: str , extra: str ): str One mapping field with more settings, such as an analyzer.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Properties (props: Vector < str >): str The mapping properties object from fields.
The example for this item is shown with the ones above: db-opensearch-CreateIndex.salam
func Search (c: Client, index: str , query: str ): SearchResult Runs a query against an index; a list or pattern works, and an empty index means all.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchWith (c: Client, index: str , req: SearchRequest): SearchResult Runs a full search request.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchRaw (c: Client, index: str , body: str ): SearchResult Runs a search with a body you wrote.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchParamsWith (c: Client, index: str , body: str , p: SearchParams): SearchResult Runs a search body with url settings, such as a search pipeline.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func ParseSearch (body: str ): SearchResult Reads a search response you already have.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchScroll (c: Client, index: str , req: SearchRequest, keep_alive: str ): SearchResult Starts a scroll: the first page and a scroll id.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func Scroll (c: Client, scroll_id: str , keep_alive: str ): SearchResult The next page of a scroll; an empty page means the end.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func ClearScroll (c: Client, scroll_id: str ): bool Frees a scroll on the server.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func CreatePit (c: Client, index: str , keep_alive: str ): str Opens a point in time on an index, for stable paging with search_after; returns its id.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func DeletePit (c: Client, pit_id: str ): bool The example for this item is shown with the ones above: db-opensearch-Search.salam
func DeleteAllPits (c: Client): bool Closes every point in time.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func ListPits (c: Client): Vector < str > The ids of all open points in time.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func MSearch (c: Client, index: str , bodies: Vector < str >): Vector <SearchResult> Runs several search bodies against one index in one request; one result per body, in order.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchTemplate (c: Client, index: str , template_id: str , params: str ): SearchResult Runs a stored search template with parameters.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func SearchInlineTemplate (c: Client, index: str , source: str , params: str ): SearchResult Runs a mustache template given as JSON, with parameters.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func RenderTemplate (c: Client, source: str , params: str ): str The search body a template makes with the given parameters.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func Explain (c: Client, index: str , id: str , query: str ): str How a document's score for a query was computed, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func Validate (c: Client, index: str , query: str ): bool The query is valid for the index.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func FieldCaps (c: Client, index: str , fields: Vector < str >): str What each field can do in an index, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func Buckets (aggregations: str , name: str ): Vector <Bucket> The buckets of a bucket aggregation, list or keyed.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func AggValue (aggregations: str , name: str ): f64 The value of a single value aggregation such as avg.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func AggField (aggregations: str , name: str , field: str ): f64 One named number of an aggregation, such as max of stats.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func AggPercentile (aggregations: str , name: str , percent: f64 ): f64 One percentile of a percentiles aggregation, such as AggPercentile(aggs, "latency", 99.0); reads the "99.0" key that a dotted path cannot reach.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func AggRaw (aggregations: str , name: str ): str One aggregation as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func Suggestions (suggest: str , name: str ): Vector < str > The texts a suggester offered.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func JsonPath (text: str , path: str ): str A value at a dotted path, with numbers for array items, such as hits.hits.0._id; strings come back unquoted.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func JsonPathRaw (text: str , path: str ): str A value at a dotted path as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Search.salam
func JsonItems (raw: str ): Vector < str > The items of a JSON array as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Search.salam
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkIndex (b &: Bulk, index: str , id: str , doc: str ) Adds an index action; an empty id lets the server make one.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkIndexRouted (b &: Bulk, index: str , id: str , routing: str , doc: str ) Adds an index action with a routing value.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkCreate (b &: Bulk, index: str , id: str , doc: str ) Adds a create action, which fails if the id exists.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkUpdate (b &: Bulk, index: str , id: str , partial: str ) Adds an update that merges the given fields.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkUpsert (b &: Bulk, index: str , id: str , doc: str ) Adds an update that creates the document when it is missing.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkDelete (b &: Bulk, index: str , id: str ) The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkLen (b: Bulk): int How many actions the batch holds.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkBody (b: Bulk): str The NDJSON body the batch sends.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkReset (b &: Bulk) Empties the batch so it can be filled again.
The example for this item is shown with the ones above: db-opensearch-Index.salam
The example for this item is shown with the ones above: db-opensearch-Index.salam
func ParseBulk (body: str ): BulkResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkSend (c: Client, b: Bulk): BulkResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func BulkSendWith (c: Client, b: Bulk, refresh: str ): BulkResult Sends the batch with a refresh setting.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func SqlParam (kind: str , value: str ): str One query parameter for SqlWith, such as SqlParam("integer", "5").
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func Sql (c: Client, query: str ): SqlRows The example for this item is shown with the ones above: db-opensearch-Sql.salam
func SqlWith (c: Client, query: str , params: Vector < str >, fetch_size: int ): SqlRows Runs a SQL query with ? parameters and a page size.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func SqlFormat (c: Client, query: str , format: str ): str A SQL result in another format: csv, raw, json or jdbc.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func SqlExplain (c: Client, query: str ): str How a SQL query will run, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func Ppl (c: Client, query: str ): SqlRows Runs a PPL query, such as source=logs | where code > 499 | stats count() by host.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func PplFormat (c: Client, query: str , format: str ): str A PPL result in another format.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func PplExplain (c: Client, query: str ): str How a PPL query will run, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func Conn (c: Client): dyn db.Connection The client as a db.Connection, for code written against db .
The example for this item is shown with the ones above: db-opensearch-Sql.salam
func Index (c: Client, index: str , id: str , doc: str ): WriteResult Adds or replaces a document; an empty id lets the server make one.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func IndexWith (c: Client, index: str , id: str , doc: str , o: Options): WriteResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func Create (c: Client, index: str , id: str , doc: str ): WriteResult Adds a document only if no document has that id; a 409 otherwise.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func CreateWith (c: Client, index: str , id: str , doc: str , o: Options): WriteResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func Get (c: Client, index: str , id: str ): Document The example for this item is shown with the ones above: db-opensearch-Index.salam
func GetFields (c: Client, index: str , id: str , includes: Vector < str >, routing: str ): Document Reads only some source fields of a document, optionally with a routing value.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func GetSource (c: Client, index: str , id: str ): str Only the source of a document; empty when it is missing.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func Exists (c: Client, index: str , id: str ): bool The example for this item is shown with the ones above: db-opensearch-Index.salam
func Update (c: Client, index: str , id: str , partial: str ): WriteResult Merges the given fields into a document.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func UpdateWith (c: Client, index: str , id: str , body: str , o: Options): WriteResult Sends a full update body, such as {"doc":...} or {"script":...}, with options.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func Upsert (c: Client, index: str , id: str , doc: str ): WriteResult Merges the fields into a document, creating it when it is missing.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func UpdateScript (c: Client, index: str , id: str , script: str , upsert: str ): WriteResult Changes a document with a script, from Script; the upsert document, if given, is used when it is missing.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func Delete (c: Client, index: str , id: str ): WriteResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func DeleteWith (c: Client, index: str , id: str , o: Options): WriteResult The example for this item is shown with the ones above: db-opensearch-Index.salam
func MGet (c: Client, index: str , ids: Vector < str >): Vector <Document> Reads several documents of one index at once, in the order asked.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func Count (c: Client, index: str , query: str ): i64 How many documents match a query; an empty query counts all, -1 on error.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func DeleteByQuery (c: Client, index: str , query: str ): ByQueryResult Deletes every document that matches a query.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func DeleteByQueryWith (c: Client, index: str , query: str , o: Options): ByQueryResult DeleteByQuery with options.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func UpdateByQuery (c: Client, index: str , query: str , script: str ): ByQueryResult Runs a script on every document that matches a query; an empty query means all.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func UpdateByQueryWith (c: Client, index: str , query: str , script: str , o: Options): ByQueryResult UpdateByQuery with options.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func Reindex (c: Client, source: str , dest: str ): ByQueryResult Copies every document of one index into another.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func ReindexBody (c: Client, body: str , wait: bool ): ByQueryResult Reindexes with a full request body; with wait false it returns at once with a task id.
The example for this item is shown with the ones above: db-opensearch-Index.salam
func KnnIndexSettings (shards: int , replicas: int ): str Index settings with k-NN turned on; 0 shards or -1 replicas leaves that setting out.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnVectorField (dimension: int , method: KnnMethod): str The mapping of a knn_vector field.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnIndexBody (field: str , dimension: int , method: KnnMethod, extra_properties: Vector < str >): str A whole index body with k-NN turned on, one vector field and more properties.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnVector (values: Vector < f64 >): str A vector as a JSON array.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func KnnStats (c: Client): str k-NN plugin statistics as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnWarmup (c: Client, index: str ): bool Loads the vector indexes of an index into memory before the first search.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnClearCache (c: Client, index: str ): bool Drops the vector indexes of an index from memory.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnTrainModel (c: Client, model_id: str , body: str ): bool Trains a k-NN model, such as one for IVF or PQ.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnGetModel (c: Client, model_id: str ): str A trained k-NN model as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func KnnDeleteModel (c: Client, model_id: str ): bool The example for this item is shown with the ones above: db-opensearch-Knn.salam
func PutPolicy (c: Client, id: str , policy: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func UpdatePolicy (c: Client, id: str , policy: str , seq_no: i64 , primary_term: i64 ): bool Replaces an ISM policy, given the sequence number and primary term of the current one.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func GetPolicy (c: Client, id: str ): str An ISM policy as raw JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeletePolicy (c: Client, id: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func AddPolicy (c: Client, index: str , policy_id: str ): int Puts indices under a policy; returns how many, -1 on failure.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func RemovePolicy (c: Client, index: str ): int Takes indices out of their policy.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func ChangePolicy (c: Client, index: str , policy_id: str , state: str ): int Moves indices to another policy, optionally starting in a given state.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func RetryPolicy (c: Client, index: str ): int Retries a failed policy step.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func ExplainPolicy (c: Client, index: str ): str Where indices are in their policies, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func PolicyIdOf (c: Client, index: str ): str The id of the policy an index is under.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeleteAfterPolicy (description: str , min_index_age: str , patterns: Vector < str >): str A policy that deletes an index once it is older than an age such as 30d; with patterns it applies to new matching indices by itself.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func WhoAmI (c: Client): AuthInfo Who the security plugin says you are.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func SecurityHealth (c: Client): str The status of the security plugin, such as UP.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func PutUser (c: Client, name: str , password: str , backend_roles: Vector < str >, attributes: str ): bool Creates or replaces an internal user with backend roles and attributes as JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func GetUser (c: Client, name: str ): str An internal user as raw JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func Users (c: Client): Vector < str > The names of all internal users.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeleteUser (c: Client, name: str ): bool Deletes an internal user.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func ChangePassword (c: Client, current: str , password: str ): bool Changes the password of the user the client is signed in as.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func RoleBody (cluster_permissions: Vector < str >, index_patterns: Vector < str >, allowed_actions: Vector < str >): str A role body from cluster permissions, index patterns and the actions allowed on them.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func PutRole (c: Client, name: str , body: str ): bool Creates or replaces a role.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func GetRole (c: Client, name: str ): str The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeleteRole (c: Client, name: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func PutRoleMapping (c: Client, role: str , users: Vector < str >, backend_roles: Vector < str >): bool Gives a role to users and backend roles.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func GetRoleMapping (c: Client, role: str ): str A role mapping as raw JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeleteRoleMapping (c: Client, role: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func PutSearchPipeline (c: Client, id: str , body: str ): bool Creates or replaces a search pipeline.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func GetSearchPipeline (c: Client, id: str ): str A search pipeline as raw JSON.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func DeleteSearchPipeline (c: Client, id: str ): bool Deletes a search pipeline.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func NormalizationPipeline (normalization: str , combination: str , weights: Vector < f64 >): str A search pipeline body for hybrid search: a normalization technique such as min_max, a combination such as arithmetic_mean and optional weights.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func CreateMonitor (c: Client, body: str ): str Creates an alerting monitor; returns its id.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func GetMonitor (c: Client, id: str ): str The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func UpdateMonitor (c: Client, id: str , body: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func DeleteMonitor (c: Client, id: str ): bool The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func ExecuteMonitor (c: Client, id: str , dry_run: bool ): str Runs a monitor now, optionally as a dry run; returns the result as raw JSON.
The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func SearchMonitors (c: Client, query: str ): SearchResult The example for this item is shown with the ones above: db-opensearch-PutPolicy.salam
func MlRegisterModel (c: Client, body: str ): str Registers an ML Commons model; returns the task id.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlDeployModel (c: Client, model_id: str ): str Deploys a model; returns the task id.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlUndeployModel (c: Client, model_id: str ): bool The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlGetModel (c: Client, model_id: str ): str The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlDeleteModel (c: Client, model_id: str ): bool The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlGetTask (c: Client, task_id: str ): str The example for this item is shown with the ones above: db-opensearch-Knn.salam
func MlPredict (c: Client, algorithm: str , model_id: str , body: str ): str Runs a model, such as text_embedding, on input as JSON.
The example for this item is shown with the ones above: db-opensearch-Knn.salam
func GetInfo (c: Client): Info What the cluster says about itself.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Ping (c: Client): bool The example for this item is shown with the ones above: db-opensearch-Client.salam
func ClusterHealth (c: Client): Health The health of the cluster.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func WaitForStatus (c: Client, index: str , status: str , timeout: str ): Health Waits until the cluster, or one index, reaches a status such as yellow, or until the timeout.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func ClusterStats (c: Client): str Cluster statistics as raw JSON.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func ClusterState (c: Client, metrics: str ): str The cluster state as raw JSON, optionally only some metrics such as metadata.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetClusterSettings (c: Client): str The cluster settings as raw JSON, with flat names.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func PutClusterSettings (c: Client, persistent: str , transient: str ): bool Changes persistent and transient cluster settings; pass an empty string to leave one alone.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func AllocationExplain (c: Client, body: str ): str Why a shard is or is not allocated, as raw JSON.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func NodesInfo (c: Client, metrics: str ): str Information about the nodes, optionally only some metrics.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func NodesStats (c: Client, metrics: str ): str Statistics of the nodes, optionally only some metrics.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func HotThreads (c: Client): str What the busiest threads are doing, as text.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func Cat (c: Client, what: str ): Vector < str > A cat API, such as shards or nodes, as one JSON object per row.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func CatText (c: Client, what: str ): str A cat API as the aligned text table people read.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func Plugins (c: Client): Vector < str > The plugins installed on the cluster, each named once.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func HasPlugin (c: Client, name: str ): bool A plugin, such as opensearch-knn, is installed.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetTask (c: Client, task_id: str ): TaskInfo The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func WaitTask (c: Client, task_id: str , timeout: str ): TaskInfo Waits for a task to finish, up to a timeout.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func CancelTask (c: Client, task_id: str ): bool The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func ListTasks (c: Client, actions: str ): str Running tasks as raw JSON, optionally only actions matching a pattern.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func PutRepository (c: Client, name: str , kind: str , settings: str ): bool Registers a snapshot repository of a type such as fs or s3.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetRepository (c: Client, name: str ): str A snapshot repository as raw JSON.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func VerifyRepository (c: Client, name: str ): bool Checks that every node can use a repository.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func DeleteRepository (c: Client, name: str ): bool Removes a snapshot repository; the snapshots stay where they are.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func CreateSnapshot (c: Client, repo: str , snapshot: str , indices: str , wait: bool ): bool Takes a snapshot of some indices, or all when empty; with wait true it is true only when the snapshot succeeded.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetSnapshot (c: Client, repo: str , snapshot: str ): str A snapshot as raw JSON; a pattern or _all works too.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func Snapshots (c: Client, repo: str ): Vector < str > The names of all snapshots in a repository.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func SnapshotStatus (c: Client, repo: str , snapshot: str ): str The progress of a snapshot as raw JSON.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func DeleteSnapshot (c: Client, repo: str , snapshot: str ): bool The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func RestoreSnapshot (c: Client, repo: str , snapshot: str , body: str , wait: bool ): bool Restores a snapshot with a restore body, such as which indices and how to rename them.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func PutPipeline (c: Client, id: str , body: str ): bool Creates or replaces an ingest pipeline.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func Pipeline (description: str , processors: Vector < str >): str An ingest pipeline body from a description and processors.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func Processor (kind: str , config: str ): str One ingest processor, such as Processor("lowercase", `{"field":"tag"}`).
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetPipeline (c: Client, id: str ): str An ingest pipeline as raw JSON.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func DeletePipeline (c: Client, id: str ): bool Deletes an ingest pipeline.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func SimulatePipeline (c: Client, id: str , docs: Vector < str >): Vector < str > Runs documents through a pipeline without storing them; returns each result's source.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func PutScript (c: Client, id: str , source: str ): bool Stores a painless script under an id.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func PutSearchTemplate (c: Client, id: str , source: str ): bool Stores a mustache search template under an id, for SearchTemplate.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func GetScript (c: Client, id: str ): str The source of a stored script or template.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func DeleteScript (c: Client, id: str ): bool Deletes a stored script or template.
The example for this item is shown with the ones above: db-opensearch-ClusterHealth.salam
func SignRequest (method: str , host: str , path: str , body: str , region: str , service: str , access_key: str , secret_key: str , token: str , epoch: i64 ): str The AWS SigV4 headers for one request: method, host, path with query, body, region, service, keys, session token and Unix time.
db-opensearch-SignRequest.salam Copy
import db.opensearch
func main :
headers := opensearch. SignRequest (
"GET" ,
"example.amazonaws.com" ,
"/" ,
"" ,
"us-east-1" ,
"service" ,
"AKIDEXAMPLE" ,
"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY" ,
"" ,
1440938160 as i64
)
each line in headers. Split ( "\r\n" ):
if line. Len () > 0 : println line end
end
end Output X-Amz-Date: 20150830T123600Z
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=726c5c4879a6b4ccbbd3b24edbd6b8826d34f87450fbbf4e85546fc7ba9c1642
The example for this item is shown with the ones above: db-opensearch-Query.salam
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Match (field: str , text: str ): str Full text match on a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchAnd (field: str , text: str ): str Full text match where every word must be present.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchFuzzy (field: str , text: str ): str Full text match that forgives typing mistakes.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchPhrase (field: str , text: str ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchPhraseSlop (field: str , text: str , slop: int ): str The words in this order, with up to slop words between.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchPhrasePrefix (field: str , text: str ): str A phrase whose last word may be a prefix; for search as you type.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MatchBoolPrefix (field: str , text: str ): str Every word, the last as a prefix, in any order.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MultiMatch (text: str , fields: Vector < str >): str Full text match on several fields; title^2 weighs a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MultiMatchType (text: str , fields: Vector < str >, kind: str ): str MultiMatch of a type such as best_fields, most_fields, phrase or cross_fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Term (field: str , value: str ): str An exact value, for keyword fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermInt (field: str , value: i64 ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermBool (field: str , value: bool ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermCaseInsensitive (field: str , value: str ): str An exact value ignoring letter case.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Terms (field: str , values: Vector < str >): str Any of these exact values.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermsInt (field: str , values: Vector < i64 >): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermsLookup (field: str , index: str , id: str , path: str ): str Any of the values stored at a path of another document.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermsSet (field: str , values: Vector < str >, minimum_field: str ): str At least as many of these values as another field says.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Range (field: str , low: str , high: str ): str A range given as text, inclusive; leave one end empty for an open range.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func RangeExclusive (field: str , low: str , high: str ): str A range given as text, exclusive.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func RangeNum (field: str , low: f64 , high: f64 ): str A range of floats, inclusive.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func RangeInt (field: str , low: i64 , high: i64 ): str A range of integers, inclusive.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func RangeOp (field: str , op: str , value: str ): str One bound with an operator: gt, gte, lt or lte.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func DateRange (field: str , low: str , high: str , format: str , time_zone: str ): str A date range with an optional format and time zone; date math such as now-7d/d works.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func FieldExists (field: str ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func Prefix (field: str , value: str ): str The value starts with this.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Wildcard (field: str , pattern: str ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func Regexp (field: str , pattern: str ): str A regular expression on the whole value.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Fuzzy (field: str , value: str ): str A value close to this one.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Ids (ids: Vector < str >): str Documents with these ids.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func QueryString (query: str ): str A Lucene query string, such as title:salam AND year:1403.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func QueryStringFields (query: str , fields: Vector < str >, default_operator: str ): str A query string over given fields with a default operator.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SimpleQueryString (query: str , fields: Vector < str >): str A forgiving query string that never fails to parse.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func BoolOf (q: BoolQuery): str A bool query from a BoolQuery.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Bool (must: Vector < str >, filter: Vector < str >, should: Vector < str >, must_not: Vector < str >): str A bool query from the four clause lists.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func And (clauses: Vector < str >): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func Or (clauses: Vector < str >): str At least one clause must match.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Not (clause: str ): str The clause must not match.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Filtered (query: str , filters: Vector < str >): str A query plus filters that do not score.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func ConstantScore (filter: str , boost: f64 ): str A filter where every match gets the same score.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func DisMax (queries: Vector < str >, tie_breaker: f64 ): str The best scoring of several queries, plus a share of the others.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Boosting (positive: str , negative: str , negative_boost: f64 ): str Lowers the score of matches of a negative query instead of dropping them.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Nested (path: str , query: str ): str A query on nested objects.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func HasChild (child_type: str , query: str ): str Parents with a matching child, for join fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func HasParent (parent_type: str , query: str ): str Children with a matching parent, for join fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MoreLikeThis (fields: Vector < str >, like: str ): str Documents like the given text.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func ScriptQuery (source: str , params: str ): str Documents for which a script is true.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Script (source: str , params: str ): str A painless script with optional parameters as JSON.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func ScriptScore (query: str , source: str , params: str ): str Scores the matches of a query with a script.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func FunctionScore (query: str , functions: Vector < str >, score_mode: str , boost_mode: str ): str Changes the scores of a query with functions such as FieldValueFactor.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func FieldValueFactor (field: str , factor: f64 , modifier: str ): str A score function from a numeric field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func GeoDistance (field: str , lat: f64 , lon: f64 , distance: str ): str Points within a distance, such as 5km, of a place.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func GeoBoundingBox (field: str , top: f64 , left: f64 , bottom: f64 , right: f64 ): str Points within a box given by its top, left, bottom and right.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Knn (field: str , vector: Vector < f64 >, k: int ): str The k nearest neighbours of a vector, for a knn_vector field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func KnnFiltered (field: str , vector: Vector < f64 >, k: int , filter: str ): str The k nearest neighbours among the documents that match a filter.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func KnnRadial (field: str , vector: Vector < f64 >, max_distance: f64 ): str Every neighbour within a distance.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func KnnMinScore (field: str , vector: Vector < f64 >, min_score: f64 ): str Every neighbour with at least this score.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Neural (field: str , query_text: str , model_id: str , k: int ): str Semantic search: the server turns the text into a vector with a model; needs the neural search plugin.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func NeuralSparse (field: str , query_text: str , model_id: str ): str Sparse neural search with a model.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Hybrid (queries: Vector < str >): str Combines several queries, usually a text match and a neural one; run it with a normalization search pipeline.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SortAsc (field: str ): str Sort ascending by a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SortDesc (field: str ): str Sort descending by a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SortGeo (field: str , lat: f64 , lon: f64 , unit: str ): str Sort by distance from a place.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Highlight (fields: Vector < str >): str Highlight matches in these fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func HighlightTags (fields: Vector < str >, pre: str , post: str ): str Highlight with your own tags around each match.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func Collapse (field: str ): str Return only the top hit for each value of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermSuggest (name: str , text: str , field: str ): str A suggester that corrects the words of a text.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func CompletionSuggest (name: str , prefix: str , field: str , size : int ): str A suggester that completes a prefix from a completion field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TermsAgg (field: str , size : int ): str Buckets for the most common values of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func AvgAgg (field: str ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func SumAgg (field: str ): str The example for this item is shown with the ones above: db-opensearch-Query.salam
func MinAgg (field: str ): str The smallest value of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MaxAgg (field: str ): str The largest value of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func ValueCountAgg (field: str ): str How many values a field has.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func CardinalityAgg (field: str ): str About how many distinct values a field has.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func StatsAgg (field: str ): str Count, min, max, average and sum of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func ExtendedStatsAgg (field: str ): str StatsAgg plus variance and standard deviation.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func PercentilesAgg (field: str , percents: Vector < f64 >): str The given percentiles of a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func HistogramAgg (field: str , interval: f64 ): str Buckets of a fixed numeric width.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func DateHistogramAgg (field: str , calendar_interval: str ): str Buckets of a calendar interval, such as day or month.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func RangeAgg (field: str , bounds: Vector < f64 >): str Buckets between the given bounds, plus one below the first and one above the last.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func FilterAgg (query: str ): str One bucket of the documents that match a query.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func NestedAgg (path: str ): str Aggregates nested objects at a path.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func MissingAgg (field: str ): str One bucket of the documents with no value for a field.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func TopHitsAgg ( size : int ): str The best hits in each bucket.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func CompositeAgg (fields: Vector < str >, size : int ): str Pages through every combination of the values of several fields.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func AddAgg (aggs: str , name: str , agg: str ): str Adds a named aggregation to an aggregations object; start from {}.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SubAggs (agg: str , aggs: str ): str Nests aggregations inside a bucket aggregation.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func AddMember (obj: str , key: str , raw: str ): str Adds a member to a JSON object.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func SearchBody (req: SearchRequest): str The JSON body of a search request.
The example for this item is shown with the ones above: db-opensearch-Query.salam
func DefaultConfig (): Config A configuration with the default node, ready to change.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func NewClient (cfg: Config): Client Makes a client from a configuration; check it with Ok.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Connect (url: str ): Client A client for one node url; the url may carry user:password@.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func ConnectAuth (url: str , username: str , password: str ): Client A client for one node with basic authentication.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func ConnectInsecure (url: str , username: str , password: str ): Client A client that does not check the server certificate; for the demo setup and test servers only.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func ConnectAWS (url: str , region: str , service: str , access_key: str , secret_key: str , session_token: str ): Client A client that signs every request with AWS SigV4, for Amazon OpenSearch Service or Serverless.
The example for this item is shown with the ones above: db-opensearch-Client.salam
The configuration was valid.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Error (c: Client): str The error of the last request, or the configuration error.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func ErrorType (c: Client): str The server's error type from the last request.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func ErrorReason (c: Client): str The server's error reason from the last request.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Status (c: Client): int The HTTP status of the last request.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Nodes (c: Client): Vector < str > The node urls, as the client will use them.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func AuthHeader (c: Client): str The Authorization header value sent with each request; empty with AWS signing, which signs each request on its own.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func SetSigningTime (c: Client, epoch: i64 ) Fixes the clock AWS signing uses, as Unix seconds; for tests. 0 goes back to the real clock.
The example for this item is shown with the ones above: db-opensearch-Client.salam
The example for this item is shown with the ones above: db-opensearch-Client.salam
func Perform (c: Client, method: str , path: str , body: str ): Response Sends any request with a JSON body and returns the raw response.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func PerformNdjson (c: Client, method: str , path: str , body: str ): Response Sends a request with an NDJSON body, as bulk and msearch expect.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func PerformText (c: Client, method: str , path: str , body: str , content_type: str ): Response Sends a request with a body of the given content type.
The example for this item is shown with the ones above: db-opensearch-Client.salam
func EncodeBasic (username: str , password: str ): str The base64 of user:password, as basic authentication sends it.
The example for this item is shown with the ones above: db-opensearch-Client.salam