jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ard Schrijvers <a.schrijv...@onehippo.com>
Subject Re: Finetuning (JCR) Search
Date Tue, 02 Feb 2010 09:00:27 GMT
Hello Robbert,

On Tue, Feb 2, 2010 at 9:24 AM, Robbert Uittenbroek
<r.m.uittenbroek@rug.nl> wrote:
> Hello,
> I have a question regarding searching (in) the jcr:data property.
> We store the contents of our documents in the jcr:content/jcr:data
> property. We also have added many custom properties to the jcr:content
> node, like creator, modifier, storageStatus and paths.
> In most search-cases, we want to search the jcr:data contents only. It
> now seems all properties are indexed by Lucene, and when we search we
> find files which have the keywords in other properties than jcr:data.
> While we do need to be able to search those properties in certain cases,
> we also want to be able to search in 'contents only', hence the jcr:data
> property. Can this be done, and if so, how? We use the xpath search
> expression, and eventhough I've seen the SQL use jcr:data (I believe) as
> field to search on, I can't seem to do this with the xpath expression.
> Example of the used xpath expression:

First of all, I really doubt whether you want to use jcr:like. It is
really not scaling at all, let alone searching in binaries. Why aren't
you using jcr:contains?

Futhermore, searching in a single property is as simple as defining
which property to search in the jcr:contains:


jcr:contains(.,'foo') is node scope level (.)
jcr:contains(jcr:data, 'foo') search in jcr:data property

Regards Ard

> /jcr:root/webplatform/www.rug.nl//element(*,
> nt:file)/jcr:content[jcr:like(@cms:virtualPathLC, '/corporate/%') and
> @cms:type and not(@cms:type='link') and not(@cms:type='folder') and
> not(@cms:type='function') and not(@cms:type='metadata') and
> jcr:contains(., 'zernike')]/(rep:excerpt()|@cms:type) order by
> jcr:score() descending
> Any help on this matter would be appreciated.
> Kinds Regards,
> Robbert Uittenbroek

View raw message