I'm trying to get some data form OpenSearch databases using their client NuGet package in an Automation Script. I used the high-level and low-level commands to do the requests and we are not receiving anything from OpenSearch using the queries. Here is the documentation link we're using as a reference: https://opensearch.org/docs/latest/clients/OSC-dot-net/
I tried using a single nodeAddress and also a pool of node addresses to search in all nodes and we are still not receiving the information. Here are the commands we're using for requesting the data:
- High-Level: client.Search<ChannelsData>(log => log.Index("_all").Query(q => q.Match(m => m.Field(f => f.LogsChannel).Query("testChannel"))));
- Low-Level: client.Search<StringResponse>("_all", PostData.Serializable(
new
{
query = new
{
match = new
{
LogsChannel = new
{
query = "testChannel"
}
}
}
}));
The string "_all" references all indexes in the nodeAddress(es) we're communicating with. The DMA also have communication and configured OpenSearch in the Agents.
Validating in OpenSearch DevTool, we're receiving data using the same query we're sending from the test Automation Script we created.
Do we need to add an extra filter/field in the query? Is there another way to retrieve OpenSearch data?
Based on the investigations, we used the low-level .Net communication to get the desired information and create a custom JSON parser to parse and get the data needed.