You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Alan Menant <am...@jouve.fr> on 2006/05/24 11:35:51 UTC
(pas de sujet)
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.
Re: Searching problem
Posted by Alan Menant <am...@jouve.fr>.
Marcel,
I configured the text filters but no changes.
Thanks.
Marcel Reutegger a écrit :
> did you configure the text filters to extract content from binary data?
>
> See:
> http://svn.apache.org/repos/asf/jackrabbit/trunk/textfilters/README.txt
>
> regards
> marcel
>
> Alan Menant wrote:
>> Thank you Felix for your tip, but my repository was well configured,
>> like this example file.
>>
>> The folder is well indeed because when I dump it I got the following
>> result :
>>
>> test
>> /test/jcr:created=2006-05-24T11:02:43.350+02:00
>> /test/jcr:primaryType=nt:folder
>> /test/tata.txt
>> /test/tata.txt/jcr:created=2006-05-24T11:02:43.365+02:00
>> /test/tata.txt/jcr:primaryType=nt:file
>> /test/tata.txt/jcr:content
>> /test/tata.txt/jcr:content/jcr:encoding=
>> /test/tata.txt/jcr:content/jcr:data=<binary>
>> /test/tata.txt/jcr:content/jcr:primaryType=nt:resource
>> /test/tata.txt/jcr:content/jcr:mimeType=text/plain
>> /test/tata.txt/jcr:content/jcr:uuid=556b31b2-03cc-4b16-b183-9cda1fcedbbb
>> /test/tata.txt/jcr:content/jcr:lastModified=2006-05-23T16:03:50.630+02:00
>>
>> /test/toto.txt
>> /test/toto.txt/jcr:created=2006-05-24T11:02:43.365+02:00
>> /test/toto.txt/jcr:primaryType=nt:file
>> /test/toto.txt/jcr:content
>> /test/toto.txt/jcr:content/jcr:encoding=
>> /test/toto.txt/jcr:content/jcr:data=<binary>
>> /test/toto.txt/jcr:content/jcr:primaryType=nt:resource
>> /test/toto.txt/jcr:content/jcr:mimeType=text/plain
>> /test/toto.txt/jcr:content/jcr:uuid=d579c973-7a02-47c9-a2bc-3fa098bdeb2f
>> /test/toto.txt/jcr:content/jcr:lastModified=2006-05-23T15:50:10.089+02:00
>>
>>
>>
>> That's the searching who's not working.
>>
>>
>>
>> Felix Satyaputra a écrit :
>>> Hi Alan,
>>>
>>> Have you tried with a repository configured with
>>> SearchIndex?
>>>
>>> If my memory serves me right, you need to configure a
>>> SearchIndex in your repository before you can run a
>>> query against it.
>>> To configure SearchIndex look at sample config in
>>> http://jackrabbit.apache.org/doc/config.html where
>>> SearchIndex is configured.
>>>
>>> Regards,
>>>
>>> Felix
>>>
>>>
>>> --- Alan Menant <am...@jouve.fr> wrote:
>>>
>>>
>>>> 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.
>>>>
>>>>
>>>
>>>
>>>
>>> ___________________________________________________________
>>> Try the all-new Yahoo! Mail. "The New Version is radically easier to
>>> use" – The Wall Street Journal http://uk.docs.yahoo.com/nowyoucan.html
>>>
>>>
>>
>>
>
Re: Searching problem
Posted by Marcel Reutegger <ma...@gmx.net>.
did you configure the text filters to extract content from binary data?
See: http://svn.apache.org/repos/asf/jackrabbit/trunk/textfilters/README.txt
regards
marcel
Alan Menant wrote:
> Thank you Felix for your tip, but my repository was well configured,
> like this example file.
>
> The folder is well indeed because when I dump it I got the following
> result :
>
> test
> /test/jcr:created=2006-05-24T11:02:43.350+02:00
> /test/jcr:primaryType=nt:folder
> /test/tata.txt
> /test/tata.txt/jcr:created=2006-05-24T11:02:43.365+02:00
> /test/tata.txt/jcr:primaryType=nt:file
> /test/tata.txt/jcr:content
> /test/tata.txt/jcr:content/jcr:encoding=
> /test/tata.txt/jcr:content/jcr:data=<binary>
> /test/tata.txt/jcr:content/jcr:primaryType=nt:resource
> /test/tata.txt/jcr:content/jcr:mimeType=text/plain
> /test/tata.txt/jcr:content/jcr:uuid=556b31b2-03cc-4b16-b183-9cda1fcedbbb
> /test/tata.txt/jcr:content/jcr:lastModified=2006-05-23T16:03:50.630+02:00
> /test/toto.txt
> /test/toto.txt/jcr:created=2006-05-24T11:02:43.365+02:00
> /test/toto.txt/jcr:primaryType=nt:file
> /test/toto.txt/jcr:content
> /test/toto.txt/jcr:content/jcr:encoding=
> /test/toto.txt/jcr:content/jcr:data=<binary>
> /test/toto.txt/jcr:content/jcr:primaryType=nt:resource
> /test/toto.txt/jcr:content/jcr:mimeType=text/plain
> /test/toto.txt/jcr:content/jcr:uuid=d579c973-7a02-47c9-a2bc-3fa098bdeb2f
> /test/toto.txt/jcr:content/jcr:lastModified=2006-05-23T15:50:10.089+02:00
>
>
> That's the searching who's not working.
>
>
>
> Felix Satyaputra a écrit :
>> Hi Alan,
>>
>> Have you tried with a repository configured with
>> SearchIndex?
>>
>> If my memory serves me right, you need to configure a
>> SearchIndex in your repository before you can run a
>> query against it.
>> To configure SearchIndex look at sample config in
>> http://jackrabbit.apache.org/doc/config.html where
>> SearchIndex is configured.
>>
>> Regards,
>>
>> Felix
>>
>>
>> --- Alan Menant <am...@jouve.fr> wrote:
>>
>>
>>> 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.
>>>
>>>
>>
>>
>>
>>
>> ___________________________________________________________ Try the
>> all-new Yahoo! Mail. "The New Version is radically easier to use" –
>> The Wall Street Journal http://uk.docs.yahoo.com/nowyoucan.html
>>
>>
>
>
Re: Searching problem
Posted by Alan Menant <am...@jouve.fr>.
Thank you Felix for your tip, but my repository was well configured,
like this example file.
The folder is well indeed because when I dump it I got the following
result :
test
/test/jcr:created=2006-05-24T11:02:43.350+02:00
/test/jcr:primaryType=nt:folder
/test/tata.txt
/test/tata.txt/jcr:created=2006-05-24T11:02:43.365+02:00
/test/tata.txt/jcr:primaryType=nt:file
/test/tata.txt/jcr:content
/test/tata.txt/jcr:content/jcr:encoding=
/test/tata.txt/jcr:content/jcr:data=<binary>
/test/tata.txt/jcr:content/jcr:primaryType=nt:resource
/test/tata.txt/jcr:content/jcr:mimeType=text/plain
/test/tata.txt/jcr:content/jcr:uuid=556b31b2-03cc-4b16-b183-9cda1fcedbbb
/test/tata.txt/jcr:content/jcr:lastModified=2006-05-23T16:03:50.630+02:00
/test/toto.txt
/test/toto.txt/jcr:created=2006-05-24T11:02:43.365+02:00
/test/toto.txt/jcr:primaryType=nt:file
/test/toto.txt/jcr:content
/test/toto.txt/jcr:content/jcr:encoding=
/test/toto.txt/jcr:content/jcr:data=<binary>
/test/toto.txt/jcr:content/jcr:primaryType=nt:resource
/test/toto.txt/jcr:content/jcr:mimeType=text/plain
/test/toto.txt/jcr:content/jcr:uuid=d579c973-7a02-47c9-a2bc-3fa098bdeb2f
/test/toto.txt/jcr:content/jcr:lastModified=2006-05-23T15:50:10.089+02:00
That's the searching who's not working.
Felix Satyaputra a écrit :
> Hi Alan,
>
> Have you tried with a repository configured with
> SearchIndex?
>
> If my memory serves me right, you need to configure a
> SearchIndex in your repository before you can run a
> query against it.
>
> To configure SearchIndex look at sample config in
> http://jackrabbit.apache.org/doc/config.html where
> SearchIndex is configured.
>
> Regards,
>
> Felix
>
>
> --- Alan Menant <am...@jouve.fr> wrote:
>
>
>> 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.
>>
>>
>
>
>
>
> ___________________________________________________________
> Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal
> http://uk.docs.yahoo.com/nowyoucan.html
>
>
Re: (pas de sujet)
Posted by Felix Satyaputra <f_...@yahoo.co.uk>.
Hi Alan,
Have you tried with a repository configured with
SearchIndex?
If my memory serves me right, you need to configure a
SearchIndex in your repository before you can run a
query against it.
To configure SearchIndex look at sample config in
http://jackrabbit.apache.org/doc/config.html where
SearchIndex is configured.
Regards,
Felix
--- Alan Menant <am...@jouve.fr> wrote:
> 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.
>
___________________________________________________________
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" The Wall Street Journal
http://uk.docs.yahoo.com/nowyoucan.html