jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shoener" <mshoe...@softwareapps.net>
Subject RE: Query mixin and nt:resource nodes
Date Thu, 01 Oct 2009 13:08:23 GMT
I haven't touched any of the indexing configuration settings and from what I
have seen the default is to index the basic file types I am storing in the
repository.

What I am trying to do is have my query search on both the binary file data
and my custom mixin which is added to the nt:resource node.

Should I be adding the mixin to the parent nt:file node? If so, then what
node type do I search on in my query?

I have a custom mixin defined called "hfs:fileInfo". Is has several
properties (description, entered, modified).

What would the query look like to search on both the binary file data and my
custom mixin properties?


Best Regards,

Michael Shoener
Support Staff
Software Application Services, Inc.


-----Original Message-----
From: mreutegg@day.com [mailto:mreutegg@day.com] On Behalf Of Marcel
Reutegger
Sent: Thursday, October 01, 2009 5:17 AM
To: users@jackrabbit.apache.org
Subject: Re: Query mixin and nt:resource nodes

Hi,

On Mon, Sep 28, 2009 at 23:54, Michael Shoener <mshoener@softwareapps.net>
wrote:
> I tried your suggestion to use @jcr:data and still get nothing.

see: http://jackrabbit.apache.org/frequently-asked-questions.html

"Why doesn't //*[jcr:contains(@jcr:data, 'foo')] return matches for binary
content?"

> What exactly does the "." in the jcr:contains search in relation to 
> the node?

it means that the XPath context node is searched using the
jcr:contains() function. In jackrabbit jcr:contains will search all
properties on that node unless otherwise configured in the indexing
configuration.

see: http://wiki.apache.org/jackrabbit/IndexingConfiguration

> Any other suggestions?

you could separate the resource from the file. e.g. have the description
property on a node that is distinct from the node where you have the
jcr:data on.

using built in node types that would be:

//element(*, nt:file)[jcr:contains(jcr:content, 'example')]

or if you also want to search on description:

//element(*, nt:file)[jcr:contains(@description, 'example' or
jcr:contains(jcr:content, 'example')]

(assuming you have a custom node type that extends from nt:file and allows
you to set @description)

regards
 marcel


Mime
View raw message