New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter CSV Fields _in & _nin don't work when multiple values present #22176
Comments
As correctly pointed out in #11309 (comment) the CSV fields are stored as simple strings in the DB and filter operations are plain string operations. In this context the Effectively the "is one of" operation for a CSV value should read more as a "contains one of", since we want to check the overlap between the CSV values and the filter values. Since on the DB side of things they are strings only and have no notion of being separate items, there is no nice ways of filtering the records that works reliably and efficiently. As such we should think about maybe disabling the In the particular case of having tags, the cleaner solution from a DB standpoint would be to have a separate |
Describe the Bug
Data Studio filters allow for
Is one of
(_in
) andIs not one of
(_nin
) operations, however, they don't work when multiple values present in the field. Since it is an available option for the operations of this field type, the results should include any items with matching values in the csv list.Existing/Related Issues:
There are some related tickets, but they were closed as fixed with the recent
_contains
PR or closed due to overlap with JSON filtering.#12496
#11309
OPTIONAL:
It would also be great to provide selection of available values(at least the preset ones) like the current dropdown fields do.
Known workaround is the use multiple
Contains
(_contains
) andDoesn't contain
(_ncontains
) with logical AND/OR, but is hard for Data Studio users to set up and use. Noted workarounds in other tickets:#12496 (comment)
#11309 (comment)
To Reproduce
Create a collection with a
tags
csv data type field egkeywords
Add a few records to the collection
content
data
content
ORcontent
data
Add a filter to the tags field in the collection layout
keywords
Is one of
content
Before filter and showing the valid options:
Filter Example with missing records:
content
in the tagsDirectus Version
v10.10.5
Hosting Strategy
Directus Cloud
The text was updated successfully, but these errors were encountered: