jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ard Schrijvers <a.schrijv...@onehippo.com>
Subject Re: Query contains question
Date Wed, 11 Aug 2010 18:26:18 GMT
On Wed, Aug 11, 2010 at 6:13 PM, Simon Gaeremynck <gaeremyncks@gmail.com> wrote:
> We're on 2.1.0 .
> I probably can't use jcr:like as that needs a specific property
> and I need it to match on all the properties on a node.

hmmm...that is unfortunate. I am then not sure if it is possible. I
think it is a pity that a phrase query does not work in jcr contains.
It used to work before. Perhaps someone else has an option for you
(you can of course use a lucene analyzer that does not tokenize on a
dash, but i guess that is not the solution you want either..)

Regards Ard

>
> Cheers,
> Simon
>
>
> On 11 Aug 2010, at 17:38, Ard Schrijvers wrote:
>
>> On Wed, Aug 11, 2010 at 5:27 PM, Simon Gaeremynck <gaeremyncks@gmail.com> wrote:
>>> Thanks Ard,
>>> I think I'm getting closer.
>>>
>>> The following matches the node I want
>>>  jcr:contains(., '"Anne-Sophie"')
>>>
>>> This however doesn't match anything
>>>  jcr:contains(., '"Anne-S*"')
>>
>> Which version do you use? It works for me, although it might have
>> changes as it is not part of the spec. You can use jcr:like, that is
>> part of the spec
>>
>> Regards ARd
>>
>>>
>>> Regards,
>>> Simon
>>>
>>>
>>> On 11 Aug 2010, at 15:07, Ard Schrijvers wrote:
>>>
>>>> For this thing you can use jcr:like or use
>>>> //*[jcr:contains(.,'"Anne-S*"')] although I am not completely sure if
>>>> the latter always works. The problem you have is that you cannot
>>>> search for terms starting with 'Anne-S' as there are no Lucene terms
>>>> starting with it! This is because the standard lucene analyzer
>>>> tokenizes on a dash, hence, there is for example the term 'Anne' and
>>>> 'Sophie'. Check 'Ann*', that one will work! This might be
>>>> confusing..but it gets even much more complex when iso latin1 filters
>>>> and stemming is applied.
>>>>
>>>> Anyway, back to the '"Anne-S*"'. When putting " " around it, it will
>>>> be treated as a Lucene PhraseQuery [1] which does the job for you (I
>>>> think/hope :) )
>>>>
>>>> Regards Ard
>>>
>
>

Mime
View raw message