jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shoener" <mshoe...@softwareapps.net>
Subject RE: Custom node or mixin added to existing node
Date Fri, 09 Oct 2009 21:19:42 GMT
So if I create a custom mixin and apply it to the "nt:file" node, and then
do the following query:

	 //element(*,hfs:fileInfo)[jcr:contains(jcr:content, 'testing') or
jcr:contains(@hfs:description, 'testing')]

It will return all of the nodes where the binary content matches my search
term or the "hfs:description" property value matches the search term.

Is this correct?


Best Regards,

Michael Shoener
Support Staff
Software Application Services, Inc.


-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Friday, October 09, 2009 11:55 AM
To: users@jackrabbit.apache.org
Subject: Re: Custom node or mixin added to existing node

On Fri, Oct 9, 2009 at 16:20, Michael Shoener <mshoener@softwareapps.net>
wrote:
> But the problem with the following query:
>
>        //element(*,hfs:fileInfo)[jcr:contains(., 'testing') or 
> jcr:contains(@hfs:description, 'testing')]
>
> Is that is searches on the entire node, not just the file contents and 
> my specified property.  I would like to only search on specific 
> properties and the file contents, not the entire node. I would like to 
> keep the meta data separate from the actual file contents. So do I 
> create a mixin and add that to the "nt:file" parent node of the 
> "nt:resource" node that holds the actual binary file data? If so then do I
query against my custom mixin type?

This query assumes the mixin to be set on the jcr:content node (with primary
resource type nt:resource), as you noted for your first query.

> Also, I thought in order to have the property returned, whether it 
> contained the term being searched or not, I had to put the 
> /(hfs:description |
> hfs:anotherpropertyname) at the end of the query. Is that incorrect then?

The result always consists of the full node. Just specifying the property
you'll access doesn't make it faster.

Regards,
Alex

--
Alexander Klimetschek
alexander.klimetschek@day.com


Mime
View raw message