jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject Re: search
Date Thu, 13 Oct 2005 11:26:07 GMT
It depends on what you are looking for.
Maybe the unit tests can help : see on
jackrabbit/src/test/org/apache/jackrabbit/test/api/query
I advise you to read the JCR spec. There are many information on
searching support.

Here is a code example :
                        jcrExpression = "/jcr:root/test//element(*,
graffito:paragraph) [jcr:contains(@graffito:text, 'Graffito')]";
			javax.jcr.query.Query jcrQuery =
session.getWorkspace().getQueryManager().createQuery(jcrExpression,
javax.jcr.query.Query.XPATH);

			QueryResult queryResult = jcrQuery.execute();

			NodeIterator nodeIterator = queryResult.getNodes();



			ArrayList result = new ArrayList();

			while (nodeIterator.hasNext())

			{

				Node node = nodeIterator.nextNode();

				log.debug("Node found : " + node.getPath());

				result.add(objectConverter.getObject(session,
query.getFilter().getFilterClass(), node.getPath()));

			}

Christophe


On 10/13/05, Eugeny N Dzhurinsky <eugenydzh@jdevelop.com> wrote:
> Could somebody please explain how to use search within jackrabbit repository
> to find some set of nodes?
>
> --
> Eugene N Dzhurinsky
>

Mime
View raw message