Bug #12251

[API] Strict checks for "@@" filter operand

Added by Tom Clegg over 1 year ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
Start date:
09/13/2017
Due date:
% Done:

0%

Estimated time:
Story points:
1.0

Description

The operand of a @@ filter should be checked against a well-defined format.
  • If the operand does not follow this format, the request should be rejected 4xx.
  • If the operand does follow this format, the request should behave predictably.
Specifically:
  • API should support queries like "foo bar", "foo & bar", "foo*&bar*", "foo* bar", "foo|bar" where "*" enables prefix matching, & means and, and | means or.
  • At least for now, queries with non-alphanumeric characters other than |&* and space should return 422 errors; likewise malformed queries like "&foo", "bar&", "foo&&bar", "foo& |bar".
  • Except: for compatibility, start by silently replacing :* with *.
Also:
  • A query like "a" ("a" being a "stop word") should match everything. This is consistent with the behavior of "foobar a", which matches everything containing "foobar". (Currently, "a" matches nothing.)
    • This can be implemented by passing the supplied search string through select to_tsquery(x) and skipping the filter entirely if the result is empty.

When implementing, please review the Workbench portion of this story done in #12194 to ensure expectations match.


Related issues

Related to Arvados - Bug #12194: [API] [Workbench] Colons and ampersands in search should not produce errorsResolved2017-08-30

History

#1 Updated by Tom Morris about 1 year ago

  • Target version set to 2017-10-11 Sprint

#2 Updated by Tom Morris about 1 year ago

  • Story points set to 1.0

#3 Updated by Tom Morris about 1 year ago

  • Target version changed from 2017-10-11 Sprint to Arvados Future Sprints

Also available in: Atom PDF