jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Querying multi-valued properties
Date Fri, 09 Oct 2009 08:02:46 GMT
Hi,

On Thu, Oct 1, 2009 at 17:01, Mohinder Singh <msingh@swri.org> wrote:
> Hi,
> I am using following query to get the multi-valued property 'keywords' from
> 'partialKeywords' (in order to achieve 'Google suggest' like behavior):
>
> "//element(*, sw:resource)/@sw:keywords[jcr:like(@sw:keywords, '%" +
> partialKeyword + "%')]";
>
> How can I now retrieve multi-valued 'keywords' quickly from the query
> result?

you get the NodeIterator from the query result and then get the
property values using the regular API:
node.getProperty('sw:keywords').getValues()

please note that jcr:like with wildcard prefixes might be slow.
Specifically if you have lots of distinct values for that property. I
suggest you use jcr:contains if possible.

regards
 marcel

Mime
View raw message