jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabián Mandelbaum <fmandelb...@gmail.com>
Subject Re: Searching for file names (nt:file node names) with JR 1.6.x
Date Fri, 29 Oct 2010 15:00:35 GMT
Thanks Neil and Alex for your answers.

So, I've added the cco_fname property to my repository and wrote the
migration tool (so old repos will be filename-searchable too). Search
looks to be working now, as you can see below:

fabman@monster:~$ curl -i -uadmin@calenco.com:admin
http://localhost:9000/workspaces/Test/content/searchresult?q=calenco\&lang=en\&classif=C1
HTTP/1.1 200 OK
Content-Length: 461
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Oct 2010 14:55:12 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/2.0.1

Full Text Query:/jcr:root/workspaces/Test/content/en/*[@jcr:primaryType='nt:file'
and jcr:contains(jcr:content, 'calenco')]
Search Result: 1 node(s).
Filename Query:/jcr:root/workspaces/Test/properties/en/*[@jcr:primaryType='nt:unstructured'
and jcr:like(@cco_fname, '%calenco%')]
Search Result: 0 node(s).
Classifs Query:/jcr:root/workspaces/Test/associations/*[@kind='isClassifiedOnto'
and @to='/workspaces/Test/classifications/C1']
Search Result: 0 node(s).

fabman@monster:~$ curl -i -uadmin@calenco.com:admin
http://localhost:9000/workspaces/Test/content/searchresult?q=Calenco\&lang=en\&classif=C1
HTTP/1.1 200 OK
Content-Length: 461
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Oct 2010 14:55:19 GMT
Accept-Ranges: bytes
Server: Restlet-Framework/2.0.1

Full Text Query:/jcr:root/workspaces/Test/content/en/*[@jcr:primaryType='nt:file'
and jcr:contains(jcr:content, 'Calenco')]
Search Result: 1 node(s).
Filename Query:/jcr:root/workspaces/Test/properties/en/*[@jcr:primaryType='nt:unstructured'
and jcr:like(@cco_fname, '%Calenco%')]
Search Result: 1 node(s).
Classifs Query:/jcr:root/workspaces/Test/associations/*[@kind='isClassifiedOnto'
and @to='/workspaces/Test/classifications/C1']
Search Result: 0 node(s).
fabman@monster:~$

However, it seems like jcr:like is case sensitive (because the 1st
filename query doesn't match). Is there any way I can make it case
un-sensitive? Some query parameter? Some index configuration?

Thanks in advance for your answers.

On Fri, Oct 22, 2010 at 2:41 PM, Alexander Klimetschek <aklimets@day.com> wrote:
> On Fri, Oct 22, 2010 at 19:35, Neil Corbet
> <ncorbet@towerhillservices.com> wrote:
>> Fabián Mandelbaum <fmandelbaum <at> gmail.com> writes:
>>> I'm using JackRabbit 1.6.2 on my project and I was wondering which
>>> would be the query to execute (either XPath or SQL) to be able to
>>> search for a given string in a file name (search in file names).
>>
>> I think you may want to use the fn:name() function in the query. Something like:
>> " fn:name() LIKE 'Samba' " you could include the "jcr:path LIKE
>> '/workspaces/W1/content/%'" to help guide it down the right path and use
>> fn:name() to narrow it down to a set of names.
>
> No, fn:name() in jcr-sql (the one from jcr 1.0, in Jackrabbit 1.x)
> does not support wildcards.
>
> Wild card search on node names is only possible since Jackrabbit 2.0
> using JCR-SQL2. See
> http://jackrabbit.markmail.org/thread/xvoo5afksxtyplhw
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
Fabián Mandelbaum
IS Engineer

Mime
View raw message