You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Julian Sedding <js...@gmail.com> on 2015/09/18 14:03:14 UTC

Is there query support for CONTAINS(path/to/property)?

Hi there

Digging through the indexing and query code, especially the lucene
part, I got the impression that full-text queries on properties are
not currently supported. Is this observation correct?

Furthermore, it seems that under the hood Lucene's full-text index is
used for (some) "LIKE" queries. This leads me to the question, whether
the following queries are semantically equivalent:

//*[jcr:contains(a/@b, 'fish')]
vs
//*[jcr:like(a/@b, '%fish%')]

If these are equivalent it would seem fairly straight forward to add
"contains" support for properties (as was present in JR2). Opinions?

Thanks and regards
Julian

Re: Is there query support for CONTAINS(path/to/property)?

Posted by Julian Sedding <js...@gmail.com>.
Hi Chetan

Thanks for this hint, that's very helpful! I'll continue down this
line and see how far that takes me. Basic tests seem promising.

Regards
Julian

On Fri, Sep 18, 2015 at 4:30 PM, Chetan Mehrotra
<ch...@gmail.com> wrote:
> Hi Julian,
>
> LucenePropertyIndex does support contains for properties, For an
> example see LucenePropertyIndexTest#fulltextBooleanComplexOrQueries.
> You can give your usecase a try
> Chetan Mehrotra
>
>
> On Fri, Sep 18, 2015 at 5:33 PM, Julian Sedding <js...@gmail.com> wrote:
>> Hi there
>>
>> Digging through the indexing and query code, especially the lucene
>> part, I got the impression that full-text queries on properties are
>> not currently supported. Is this observation correct?
>>
>> Furthermore, it seems that under the hood Lucene's full-text index is
>> used for (some) "LIKE" queries. This leads me to the question, whether
>> the following queries are semantically equivalent:
>>
>> //*[jcr:contains(a/@b, 'fish')]
>> vs
>> //*[jcr:like(a/@b, '%fish%')]
>>
>> If these are equivalent it would seem fairly straight forward to add
>> "contains" support for properties (as was present in JR2). Opinions?
>>
>> Thanks and regards
>> Julian

Re: Is there query support for CONTAINS(path/to/property)?

Posted by Chetan Mehrotra <ch...@gmail.com>.
Hi Julian,

LucenePropertyIndex does support contains for properties, For an
example see LucenePropertyIndexTest#fulltextBooleanComplexOrQueries.
You can give your usecase a try
Chetan Mehrotra


On Fri, Sep 18, 2015 at 5:33 PM, Julian Sedding <js...@gmail.com> wrote:
> Hi there
>
> Digging through the indexing and query code, especially the lucene
> part, I got the impression that full-text queries on properties are
> not currently supported. Is this observation correct?
>
> Furthermore, it seems that under the hood Lucene's full-text index is
> used for (some) "LIKE" queries. This leads me to the question, whether
> the following queries are semantically equivalent:
>
> //*[jcr:contains(a/@b, 'fish')]
> vs
> //*[jcr:like(a/@b, '%fish%')]
>
> If these are equivalent it would seem fairly straight forward to add
> "contains" support for properties (as was present in JR2). Opinions?
>
> Thanks and regards
> Julian