Attribute searching: search strings lexicographically
Closed this issue · 2 comments
yankovs commented
yankovs commented
Edit: I think this isn't an issue with the string comparison, but with the -
in the string.
psrok1 commented
🤔 Yeah, I think it's more a bug. Search like that is converted to the jsonpath query value @? '$.vt.last_analysis_str ? @ <= 2024-07-07
because I assumed that range queries can be done only with numerical values. Unfortunately that assumption doesn't come with any validation.
If lexicographical compare works with jsonpath, I think it's just enough to add quotes and proper escapes when queried value doesn't look like a number (using jsonpath_quote
-
mwdb-core/mwdb/core/search/parse_helpers.py
Line 284 in e2ea6cb
I'll try to fix that soon!