Clarification needed on the use of quotes in a CONTAINS() query to search on phrases

    • Type: Improvement
    • Resolution: Applied
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Component/s: Domain Model
    • None
    • Hide

      <phrase> ::= <double-quote> <word> [

      {<space> <word>}

      ... ] <double-quote>
      <double-quote> ::= ' " '

      Show
      <phrase> ::= <double-quote> <word> [ {<space> <word>} ... ] <double-quote> <double-quote> ::= ' " '
    • Hide

      See 23 August 2010 comment.

      Show
      See 23 August 2010 comment.

      Clarification needed on the use of quotes in a CONTAINS() query to search on phrases.

      Spec:
      2575 BNF grammar structure:: CONTAINS ( [ <qualifier> ,] ' <text search expression> ' )

      2413 <phrase> ::= <quote> <word> [

      {<space> <word>}

      ... ] <quote>
      2422 <quote> ::= "'" !! Single-quote only, consistent with SQL-92 string literal
      2597 Within a word or phrase, each (single-)quote must also be escaped by a preceding backslash "\"

      The spec specifically states that <quote> is single-quote only.
      My questions is on specifying a phrase inside the CONTAINS().
      Since the entire text search expression is enclosed in single quotes,
      I question whether a phrase should again be enclosed in single quotes, or should it be in double-quotes.

      According to spec:
      Word search: CONTAINS('house')
      Phrase search : CONTAINS(' 'my house' ')
      Should phrases be in double-quotes? ==> CONTAINS(' "my house" ')

            Assignee:
            Florian Müller (Inactive)
            Reporter:
            Jane Doong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: