jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomasg <thomasgascoi...@hotmail.com>
Subject Restricting xpath query to document text
Date Wed, 26 Apr 2006 14:53:39 GMT

I have extended nt:resource so I can add various properties to the new node
type which is named axxia:resource.

I am running queries such as:

//element(*, axxia:resource)[jcr:contains(@axxia:title, 'Jackbunny')

to search for words in the properties. Its all working well! The only
problem I have at present is when I want to search ONLY in the contents of
the added document. Then I am doing the following query:

//element(*, axxia:resource)[jcr:contains(., 'Jackbunny')

which is ok and returns a hit when the document contains the word. The
problem is it also returns a hit if the word is not in the document but is
in any of my properties.

How can I modify the query to return hits when the word is in the document
body and not if it is just in one of the properties?
Oh, plus another question while I'm at it. Is there any limit (absolute or
performance) to the number of clauses one can add to the [] (square bracket)
part of the query? Mine potentially could get very large.


p.s. Just tested that a predicate like this works but hope there is a
shorter method:
[jcr:contains(., 'XXYYZZ') and jcr:contains(@axxia:subject, '-XXYYZZ') and
... etc, all my properties I want to exclude...]


Any suggestions would be cool, cheers Thomas

--
View this message in context: http://www.nabble.com/Restricting-xpath-query-to-document-text-t1512215.html#a4102828
Sent from the Jackrabbit - Dev forum at Nabble.com.


Mime
View raw message