Trouble filtering on date
See original GitHub issueI have an index called private_data, with documents such as exact.date, name, etc. The data type in exact.date is date.
My code right now is
s = Search(using=client, index = ['private_data']).source(['exact.date']).query("match",date= (datetime.date.today()))
The problem is the format of the exact.date documents is for example 2018-07-02T06:55:55.569Z, whereas datetime is in the format month-day-year. Is datetime still the best option to use in this scenario?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Excel Not Grouping Dates in Filters? How to Fix It!
Reason 1: Grouping dates in filters is disabled · In Excel, go to File. · Click on Options (usually in the left bottom...
Read more >Can't fix a problem filtering date - Microsoft Power BI Community
I'm facing a problem when trying to filter a date from a calendar table related to a fact table. Basically I've created a...
Read more >Filter date problem - Power Platform Community - Microsoft
I am building what should be relatively easy. I am getting items then filtering by Odata however the filter on date doesn't seem...
Read more >Why am I having trouble filtering by date and time using ...
I have a data frame, and I'm trying to keep records after 10:05 AM on 1/22/21. df1$`Date/Time Opened` <- as_datetime(df1$`Date/Time Opened`) ...
Read more >Thread: Date Filter Problem - Excel Help Forum
It's simple, if the ORG Date is empty, Update Date is empty too, if not it display date from ORG Date. Only when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because you are doing an exact match against the
date
value (== number of miliseconds since the epoch) so only the exact same date, down to a milisecond, would match. If you want the whole day you need to use therange
query/filter:@johnsiano
match
will always choose the appropriate way to match a field and sincedate
is stored as a number, there can be no partial match so it requires an exact match. Same applies tokeyword
fields etc.Scoring typically only makes sense for
text
fields.