Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1296

Allow all non-whitespace characters in a search word, and allow unbalanced quotes and parentheses

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS01
    • Fix Version/s: V4.01_CS02
    • Component/s: ABNF, URL Conventions
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Clients can send unbalanced expressions in $search to simplify type-ahead use cases if these unbalanced expressions are sent as OData string literals, i.e. enclosed in single quotes, and single quotes within the string need to be doubled to escape them.

      Services can announce this feature via term property Capabilities.SearchRestrictions/AllowUnbalancedExpressions (boolean, default false).

      Show
      Clients can send unbalanced expressions in $search to simplify type-ahead use cases if these unbalanced expressions are sent as OData string literals, i.e. enclosed in single quotes, and single quotes within the string need to be doubled to escape them. Services can announce this feature via term property Capabilities.SearchRestrictions/AllowUnbalancedExpressions (boolean, default false).
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-abnf/pull/18/files https://www.oasis-open.org/committees/download.php/65500/odata-v4.01-wd06-part2-url-conventions-2019-06-20.docx  

      Description

      The ABNF rule for searchWord is overly restrictive, allowing only Unicode letters, numbers, and some punctuation characters. Character sequences with other characters need to be enclosed in double-quotes to pass the ABNF, i.e. be formulated as a searchPhrase.

      However double-quoted "phrases" typically have special meaning for search engines, e.g. use exact, non-fuzzy match, meaning that $search=word and $search="word" have different results.

      Also when used for type-ahead the search expression will typically be incomplete while the user is typing, and the user's expectation is to already see matching proposals while typing. All these search requests should give a search result and none of them should lead to an error:

      $search="
      $search="b
      $search="bl
      $search="blu
      $search="blue
      $search="blue%20
      $search="blue%20p
      $search="blue%20pi
      $search="blue%20pil
      $search="blue%20pill
      $search="blue%20pill"
      

       Same for unbalanced parentheses.

       

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: