The following is a query written in C#. It leverages Elastic.Clients.Elasticsearch version 8.13.7. This is NOT the NEST client.
The query uses myTenants which is passed in as a parameter to the method. The type of myTenants is IEnumerable<Tuple<string, string>>. Each item in the list represents and ORI/CRI pair. I need to update the query to traverse the entire myTenants list. The query should return all SubmissionDto where the ORI/CRI combination is equal to those in myTenants
I've tried a bunch of different queries cant seem to get it to work
I'm not an expert with .NET client but I'll try to help. I have a couple questions:
myTenants.ElementAt(0).Item1.ToLower() and myTenants.ElementAt(0).Item2.ToLower() are static values, right?
Have you checked the actual queries that are generated by the client?
IMO the best approach to figure out what the problem is would be to make a query in Kibana Dev tools and then try to use it via the client, debugging which query is created by the client itself. This guide might be helpful to see the query generated by the client.
Im not sure what you mean by if they are static values. I was just doing some testing to make sure the query worked with 1 ori/cri pair. The issues is i need multiple ori/cri pairs but I am not sure how to construct that query dynamically ( based on the array ) in c#. I am using the kibana tool to debug also. THanks for the resposne
oh ok i misunderstood static in this context. No the values are not static. This was me just making sure the query worked when there was just 1 ori/cri pair. I am trying to achieve the following logic
(Ori = A && Cri = B) || (Ori = C && Cri = D) || ...
So the query needs to be dynamically built based on what is in myTenants
I see. Indeed it should be possible with the approach that you're taking. Have you had a chance to build a query yourself in Kibana Dev Tools and compare to the query generated by the client?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.