Open zackkatz opened 7 years ago
Possibly related: #821
This works for me. Closing until needed.
@soulseekah I was able to reproduce with Multi Select.
GFQuery does not know how to search within JSON fields it seems.
GF_Query_JSON_Literal
is detected but %urology%
is not converted to %"urology"%
for exact matching. Wrapping the term with "
signs produces a lot of \\\\"
that don't match what we need when escaped.
I think we need to somehow override these JSON-based multifields in the query and add them as quoted searches.
Something like this works, but I don't like it at the moment. I want to give it some more thought.
We also need figure out how to make the "is" and "contains" operators work for JSON-based multifields.
I'm assuming "is" has to match the selection exactly, so ["one","two"] is NOT "one", but is ["one","two"]. "contains" matches a partial ["one","two"] contains "one".
This is only for select, multiselect, dropdown, radio search controls. Text search is always inexact, unless quoted, I think. Searching for "urology"
will only give out "urology" not "neurology".
Still investigating.
@soulseekah What feedback do you need for this?
Quoting from above:
we also need figure out how to make the "is" and "contains" operators work for JSON-based multifields.
I'm assuming "is" has to match the selection exactly, so ["one","two"] is NOT "one", but is ["one","two"]. "contains" matches a partial ["one","two"] contains "one".
This is only for select, multiselect, dropdown, radio search controls. Text search is always inexact, unless quoted, I think. Searching for "urology" will only give out "urology" not "neurology".
Yep that sounds good, @soulseekah
I'm even thinking that this is a Gravity Forms issue actually. And that it has to be patched inside GF_Query instead.
This is still happening.
Multiselect inputs are deprecated in Gravity Forms; they show an accessibility notice when using the field…this is less of a problem as it's being used less.
Example issues:
The following fields should use exact-match, not "contains":
Update: Select fields work as expected.