.Net: qdrant: Support Date and DateTime filtering
name: qdrant support for Date and DateTime properties about: It'd be nice to have Date and DateTime support for Date and DateTime types in the properties of the models used with qdrant vector store.
DateTime and filtering by date-time is already supported by qdrant and it's C# client, so it would also be nice if we could use it for hybrid search via IVectorStoreRecordCollection<TKey, TEntity>VectorizedSearchAsync
Tasks
- [X] DateTime/DateTimeOffset CRUD support
- [ ] DateTime/DateTimeOffset filtering support
DateTimeOffset too please
https://learn.microsoft.com/dotnet/standard/datetime/choosing-between-datetime https://stackoverflow.com/questions/4331189/datetime-vs-datetimeoffset https://ardalis.com/why-use-datetimeoffset/
Qdrant types: https://qdrant.tech/documentation/concepts/payload/#datetime
The above PR is adding datetimeoffset storage capabilities. Filtering will need to be done after a refactoring PR that is currently in progress, so moving the remaining filtering work to next sprint.
Have had to reduce the support to DateTimeOffset for now, since DateTime will produce inconsistent results. Based on a design discussion, we may reintroduce DateTime but with DateTimeKind.Utc only.
Further tracking on this in #11286
Oww, too bad. Hope it wont be delayed for long, really something I need for filtering my data for RAG.
@TsengSR, note that you can still use DateTimeOffset, and of course it is possible to convert between DateTime and DateTimeOffset.
The problem with DateTime is that it has various modes (Utc, Local and Unspecified) and since Qdrant includes timezone information in storage, we wouldn't necessarily know what time zone to store for all of these. This problem doesn't exist for DateTimeOffset, since DateTimeOffset is always timezone aware.
To see more about converting see: https://learn.microsoft.com/en-us/dotnet/standard/datetime/converting-between-datetime-and-offset
Ah okay, I misread that it was removed until this was solved. Since the expressions filter do not suppor this yet, how'd an example look with the OldFilter?
I can't seem to find an example and on the class there is only a EqualTo method, but I'd need Greater/GreaterThan/Less/LessThan comparisions (I want to limit time to filter out too old entries)