You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Torgeir Veimo <to...@netenviron.com> on 2012/06/04 06:54:15 UTC

lucene query syntax in jcr:contains()

Am I correct in assuming that jcr:contains() queries uses the lucene
syntax, as described at
http://lucene.apache.org/core/old_versioned_docs/versions/3_0_0/queryparsersyntax.html#AND

Eg. I do a search like

/jcr:root/nen:content/people//element(*,nen:profile)[jcr:contains(profileAttributes/.,
'societ~ generale~')] order by @jcr:score descending

- on nodes that have a catchall properties subnode,
'profileAttributes'. Some nodes have values such as Société Générale.
Some have only Générale etc.

When I use the syntax 'societ~ OR generale~' I get the expected result
with an OR sounds like search. However, if I omit the OR, it works
like an AND search. Also, using AND doesn't work at all (gives no
hits), while if I use &&, it seems to work as an AND search.

Also, I get different results depending on whether I use " or ', so
"societ~ generale~" works as an OR search. Is it not spec compliant to
use '' instead of ""? Or is it not a pure lucene syntax, but something
else. Is it documented somewhere?

-- 
-Tor