Problem with SearchFilter and JSONFields #7799
Unanswered
haaavk
asked this question in
Potential Issue
Replies: 1 comment
-
Also problem with full text search and JSONField:
SELECT COUNT(*) AS "__count"
FROM "monitor_server"
WHERE (("monitor_server"."disks" -> 'search') = '"dell"'
OR ("monitor_server"."nics" -> 'search') = '"dell"'
OR to_tsvector(COALESCE("monitor_server"."test", '')) @@ (plainto_tsquery('dell')) = TRUE) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is a problem with SearchFilter and JSONFields.
When I add json key to search_fields (json_field__key) I got exception:
django.core.exceptions.FieldDoesNotExist: Model has no field named 'field_name'
Exception comes from
SearchFilter
class andmust_call_distinct
method.I made quick fix by overriding
must_call_distinct
method but it's not a perfect solution.Beta Was this translation helpful? Give feedback.
All reactions