1

I know that we can write DSL queries to search OpenSearch. But for some reason, I need to execute some raw SQL queries to get the result using the dotNet client. I can execute the raw query on DevTool in the OpenSearch Dashboard but I need to execute this from the .Net Client.

POST _plugins/_sql
{
  "query":"""SELECT * FROM bookmark_questions WHERE studentId = 5"""
}

[Note: This is just a sample query.]

In ElasticSearch, it's possible. Link.

var q = new QuerySqlRequest()
{
   Query = req,
   Format = "json"
};
var resp = await _elasticClient.Sql.QueryAsync(q);

But in Opensearch, I couldn't do that. How can I execute this type of query?

1 Answer 1

0

You probably want to use the low level OpenSearch client to do this, so you can construct the query yourself rather than depending on methods implemented for the high level client.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.