[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Commented: (CMIS-660) Clarification needed onthe use of quotes in a CONTAINS() query to search on phrases
[ http://tools.oasis-open.org/issues/browse/CMIS-660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19652#action_19652 ] Jens Hübel commented on CMIS-660: --------------------------------- One more suggestion: Would it help to remove the quotes around <text search expression> and instead have them around <word>? <word> then is just a special case of <phrase>. <text search predicate> ::= CONTAINS "(" [ <qualifier> "," ] <text search expression> ")" <phrase> ::= <word> // one of <phrase> <word> now obsolete <word> ::= <quote> [ {<char>} ... ] <quote> or perhaps even better: <word> ::= <character string literal> // referring to SQL-92 Examples: CONTAINS('Elephant') // simplest form CONTAINS(cmis:document, 'Elephant' OR 'Leopard') // or CONTAINS(cmis:document, 'Elephant' 'Leopard') // and CONTAINS(cmis:document, 'Elephant' AND 'Leopard') // and as potential extension for CMIS 1.1? CONTAINS(cmis:document, 'My Elephant') // exact phrase CONTAINS('That\'s me') // exact phrase with an escaped single quote It would give us a better separation between keywords (OR) and string literals. The comma could still be used if we need more parameters in CONTAINS. <conjunct> enforces a space as separator so we don't run in the two-quotes-sequence issue. We also need to clarify section 2.1.10.3 Escaping: "... will be used to escape characters within quoted strings ..." What does that mean? CMISQL grammar refers to SQL-92 grammar symbol <character string literal> SQL-92 (http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt) says: <quote symbol> ::= <quote><quote> <quote> ::= ' "Each <quote symbol> contained in <character string literal> represents a single <quote> in both the value and the length of the <character string literal>." So do we have both then, meaning: That's me. becomes That\'\'s me.? Is it a replacement: That\'s me.? What exactly is a quoted string? A <character string literal>, a <phrase>, a <text search expression>? All? We already had interoperability issues in this area. > Clarification needed on the use of quotes in a CONTAINS() query to search on phrases > ------------------------------------------------------------------------------------ > > Key: CMIS-660 > URL: http://tools.oasis-open.org/issues/browse/CMIS-660 > Project: OASIS Content Management Interoperability Services (CMIS) TC > Issue Type: Improvement > Components: Domain Model > Affects Versions: Draft 0.70 > Reporter: Jane Doong > Assignee: Ethan Gur-esh > Priority: Minor > > 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" ') -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]