jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paco Avila" <pav...@git.es>
Subject Re: jcr:contains question
Date Fri, 23 Feb 2007 21:05:10 GMT
> I'm using  jcr:contains() to query for nodes with a given string in
> one of the properties such as the following:
>
> //entry[jcr:contains(@MyProperty,'val')]
>
> That query will not find the following node:
> <entry jcr:primaryType="nt:unstructured" MyProperty="My Value"/>
>
> However if I use this query:
> //entry[jcr:contains(@MyProperty,'val')]
>
> The node is found.  Seems to me like jcr:contains only matches on
> whole words.  Am I wrong?  Is there a way to search on partial words?
>
> BTW, I tried jcr:like with wildcards and that did not work any better,
> plus had the additional problem of being case sensitive.

What is the difference between both search? They are equals.

jcr:contains makes a full-text search using Lucene. If you want to search
for the string "val" an get a match with the string "My Value" you should
search "val*".

Mime
View raw message