You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Amir Mistric <am...@nemours.org> on 2007/06/20 19:00:10 UTC

What is allowed inside jcr:contains(."searchexp")?

Hi

I am still trying to understand what is allowed in "searchexp" of the jcr:contains.
I am trying to properly parse user entered search query and build a proper xpath query.

According to EBNF in the spec:

The EBNF for the second parameter is:
searchexp ::= [-]term {whitespace [OR] whitespace [-]term}
term ::= word | '"' word {whitespace word} '"'
word ::= /* A string containing no whitespace */
whitespace ::= /* A string of only whitespace*/


Does this means

- jcr:contains(.,'term1 term2') is equal to jcr:contains(.,'term1') and jcr:contains(.,'term2') ???
- jcr:contains(.,'term1 OR term2') is equal to jcr:contains(.,'term1') or jcr:contains(.,'term2') ??? Does OR has to be capitalized if in searchexp???
- since you cannot do "and|or not jcr:contains(.,'term2')" ("not" between jcr:contains throws lexical expression) how do you search for content that does not include a term? Is it using jcr:contains(.,'-term1')? If so can searchexp containing -term1 be combined with "OR" does it have to be standalone... 
- are the "and" and "or" the only keywords allowed between jcr:contains(.,'xxx') parts?

In order to properly construct the xpath query I need to know when do I have to "chain" the jcr:contains and when can I put the searchexp inside jcr: contains

I appreciate any help...

Amir