The following is a query written in c#. It leverages Elastic.Clients.Elasticsearch version 8.13.7. This is NOT the NEST client. This is the ASP DOTNET client. It doesn’t have a lot of documentation.
submissions = await localClient.SearchAsync<SubmissionDto>(SUBMISSION_INDEX, s => s
.Query(q => q
.Bool(b => b
.Must(
m => m.Term(tt => tt.Field(f => f.Ori).Value(myTenants.ElementAt(0).Item1.ToLower())),
m => m.Term(tt => tt.Field(f => f.Cri).Value(myTenants.ElementAt(0).Item2.ToLower())))
.Filter(f => f
.Range(rr => rr
.DateRange(dr => dr
.Field(f => f.SubmissionCreation)
.Gte(startDate.ToString("yyyy/MM/dd"))
.Lte(endDate.ToString("yyyy/MM/dd"))
.TimeZone("America/New_York"))))))
.Size(MAX_DOCUMENTS)
.Sort(sort => sort
.Field(f => f.SubmissionCreation, d => d
.Order(SortOrder.Desc))));
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
Tiffany Lynn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.