Equals empty is not same as equals star
Description
None
CSP Request Details
None
CSP Rejection Details
None
Potential Workaround
None
blocks
relates to
Checklist
hideTestRail: Results
Activity
Show:
Heikki Levanto October 11, 2018 at 8:53 AM
Julian Ladisch October 11, 2018 at 8:45 AMEdited
I disagree.title="*"
should match the empty string because the empty string contains zero characters: "A single asterisk (*) is used to mask zero or more characters." B.3.3. http://docs.oasis-open.org/search-ws/searchRetrieve/v1.0/os/part5-cql/searchRetrieve-v1.0-os-part5-cql.html#_Toc324166823
See also https://github.com/folio-org/cql2pgjson-java#matching-undefined-or-empty-values
Heikki Levanto October 11, 2018 at 8:26 AM
I have made an optimizing for the way the UI searches with
title="*"
but that gets applied for title=""
as well, which is should not. That query means any record that has a title. In case of title it doesn't matter, as it is a mandatory field, but in general, we need to be able to search for all records that have a publisher, or a language, using this notation.
Done
Created October 11, 2018 at 8:24 AM
Updated January 15, 2019 at 3:05 PM
Resolved October 11, 2018 at 9:20 AM
TestRail: Cases
TestRail: Runs
For the first, by matching every record, it also matches the empty string. As we can not support left truncation in fulltext, this is the best we can do.
For the second, this is the most common search from the UI, happens every time a search form is displayed, and nothing has been typed in it. Optimizing the
jsonb->>'title' ~ ''
away allows postgres to use other indexes and make filter queries work faster.