Procedures

Automation procedures in the OpenSearch BDK Book.

to create a (document) in opensearch

Create a document in opensearch

Input Concepts

Concept
Description
Type
Required
Default Value

index name

The name of the index.

text

Yes

(no default)

document

The document to be indexed.

json

Yes

(no default)

document id

The optional ID for the document.

text

No

(no default)

Output Concepts

Concept
Description
Type

the result of the operation

opensearch document

Examples

create a document in opensearch

create a json
use the above as the document
the document's "title" is "My New Document"
create the document in opensearch
    the index name is "my_index"

create a document in opensearch with a specific id

create a json
use the above as the document
the document's "title" is "My New Document"
create the document in opensearch
    the index name is "my_index"
    the document id is "my-custom-id"

to delete a document from opensearch

Delete a document from opensearch

Input Concepts

Concept
Description
Type
Required
Default Value

The document to delete.

opensearch document

Yes

(no default)

Examples

get a document from opensearch
    the document id is "my-document-id"
delete the document from opensearch

to get a (document) from opensearch

Get a document from opensearch by its ID

Input Concepts

Concept
Description
Type
Required
Default Value

index name

The name of the index.

text

Yes

(no default)

document id

The ID of the document to retrieve.

text

Yes

(no default)

Output Concepts

Concept
Description
Type

the OpensearchDocument object

opensearch document

Examples

get an document from opensearch

get a document from opensearch
    the index name is "my_index"
    the document id is "my-document-id"

to query some (documents) from opensearch

FILTER - CAPABLE

Query documents from Opensearch

Input Concepts

Concept
Description
Type
Required
Default Value

index name

single index name, or comma separated index or aliases to search on.

text

Yes

(no default)

query type

the type of query to perform

enum[fuzzy, match, prefix, simple, term]

No

{'class_name': 'QueryType', 'name': 'MATCH', 'value': 'match'}

Output Concepts

Concept
Description
Type

the list of OpensearchDocument objects

opensearch document

Examples

query some documents from opensearch

query some documents from opensearch
    the index name is "my_index"

query some documents from opensearch with filter expression

query some documents from opensearch whose title is "Mulholland Drive"
    the index name is "movies"
    the filter expression is "title:Mulholland Drive"

query some documents from opensearch with filter expression and fuzzy query type

query some documents from opensearch whose title is "Mulholland Drive"
    the index name is "movies"
    the filter expression is "title:Mulholland Drive"
    the query type is "FUZZY"
    the limit is 10
    the offset is 0

to update a (document) in opensearch

Update a document in opensearch

Input Concepts

Concept
Description
Type
Required
Default Value

The document to update.

opensearch document

Yes

(no default)

Output Concepts

Concept
Description
Type

the updated document

opensearch document

Examples

get a document from opensearch
    the document id is "my-document-id"
the document's source's name is "John"
update the document in opensearch
    the document id is "my-document-id"

Last updated

Was this helpful?