I have a nodejs lambda function that needs to search into an opensearch DB. I want to use the aws-sdk-v3. I found the doc here for OpenSearchClient:
But as you see, there is almost nothing explained there. For example, I have to create a AcceptInboundConnectionCommand with "params", but there are no explanations what are the properties required for this "params" object.
When I search "AcceptInboundConnectionCommand" on google, there is only 3 results… Is this SDK usable ? Or is still a prototype or something ?
2
Answers
You use the AWS SDK to manage the infrastructure of the OpenSearch cluster/domain. You don’t use the AWS SDK to make search requests to OpenSearch.
Use the OpenSearch JavaScript client.
OpenSearch javascript SDK Client is going to let you achieve it as follows.
Enter the DOMAIN_URL as the environment variable that your function code retrieves.
This lambda function code uses the following dataset to make the query, which you can upload to your OpenSearch cluster using "_bulk" API.
Save the following data as bulk.json