I tried this example : http://svn.apache.org/repos/asf/jackrabbit/trunk/contrib/examples/src/java/org/apache/jackrabbit/examples/FSImport.java

and it looks like to be working fine for indexing folders and files. My folder contains .txt and .pdf files.


The second step is to make a search on this folder...
I wrote this :

           // Recherche
           Workspace workspace = session.getWorkspace();
           QueryManager queryManager = workspace.getQueryManager();

            // Requête Xpath
Query query = queryManager.createQuery("//*[jcr:contains(.,'test')]", Query.XPATH);
           QueryResult result = query.execute();
           NodeIterator iter = result.getNodes();
System.out.println(iter.getSize()+ " résultats"); while(iter.hasNext())
           {
               Node noeud = (Node)iter.next();

System.out.println(noeud.getProperty("jcr:data").getString());
           }

This mean "Please give me all results that contains the word 'test'" (if I made no mistakes).
But I have no results at all.

I think I didn't stand everything in jackrabbit, can anyone help me ?

Thanks.

Reply via email to