jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: Search file content but not all node properties
Date Thu, 24 Sep 2009 20:25:01 GMT
On Thu, Sep 24, 2009 at 18:39, Michael Shoener
<mshoener@softwareapps.net> wrote:
> I have the following query:
>
> //element(*, hfs:fileInfo)[jcr:contains(., 'search term') or
> jcr:contains(@hfs:description, 'search term')]/(@hfs:description)
>
> It returns all documents that have the 'search term' contained in either a
> the description property, the content of the file, but it also searches all
> other property values.
>
> What I want is to search only the content and my specified property
> (description), but leave out documents that happen to have the 'search term'
> in another property.

What do you mean by content? I guess not the "." in jcr:contains(.,
'search term') as this covers the whole node (and whatever the
indexing considered as full text for the whole node.

If you want the content of the binary stream and your node is like
nt:file/nt:resource, I suggest to use jcr:contains(jcr:data, 'search
term') as that property contains the binary data in case of a
nt:resource.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message