Reputation: 275
I am attempting to construct an ElasticSearch query and am not getting the results I expect. Any help would be really appreciated!
Mapping Details:
I have indexed documents representing volunteer opportunities. Within each opportunity are fields for:
In addition, each opportunity document has:
Each nested shift document contains, for now, one nested calendarBlock document with start and end datetime fields as well as a field for the maximum number of volunteers that can sign up for that shift.
The Query
The query I am attempting to construct is a filtered query. A query string is passed in from a form on the web. Then, I need to programmatically attach at least three filters to this query:
The first two filters are working fine. The third one is where I'm stuck. I think the problem might have something to do with the complicated nesting structure. I attempted a nested filter, but I'm not sure if I did this correctly. Also the date fields are actually nested two levels deep. I am still getting results with past shifts when I attempt the query.
What is the proper way to accomplish filtering out all the opportunities with no future shifts scheduled?
Upvotes: 3
Views: 796
Reputation: 275
My problem had to do with the way I was formatting my datetimes.
Upvotes: 0