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 "jorgeeflorez ." <jo...@gmail.com> on 2019/11/28 18:24:39 UTC

Lucene Index property Definitions

 Hi all,
from the reference
<https://jackrabbit.apache.org/oak/docs/query/lucene.html#property-definitions>,
it is not clear to me the difference between the fields analyzed,
nodeScopeIndex, both says that should be set when using *contains* in
queries. But it is not clear the difference or the specific situation, I
think. Any additional reference or explanation is appreciated.

Best Regards,

Jorge

Re: Lucene Index property Definitions

Posted by "jorgeeflorez ." <jo...@gmail.com>.
Hi Vikas,
I created OAK-8811 <https://issues.apache.org/jira/browse/OAK-8811>. Thanks
for your help.

Best Regards.
Jorge

El jue., 28 nov. 2019 a las 14:06, Vikas Saurabh (<vi...@gmail.com>)
escribió:

> > I am searching using SQL-2  to create
> queries, those examples don't look familiar to me.
>
> //element(*, app:Asset)[jcr:contains(., ‘image’)] in sql2 would look like
> select [jcr:path] from [app:Asset] where contains(*, 'image')
>
> //element(*, app:Asset)[jcr:contains(jcr:content/metadata/@format,
> ‘image’)] in sql2 would look like select [jcr:path] from [app:Asset] where
> contains(jcr:content/metadata/format, 'image')
>
> Basically, nodeScopeIndex does a fulltext search on the whole selected node
> (that is the indexed property is indexed as if the node has the value being
> indexed). Otoh, analyzed would do fulltext search on the property being
> indexed itself.
>
> All that said, could you please open a doc issue to improve the language
> and add sql2 examples.
>
> --Vikas
> (sent from mobile)
>

Re: Lucene Index property Definitions

Posted by Vikas Saurabh <vi...@gmail.com>.
> I am searching using SQL-2  to create
queries, those examples don't look familiar to me.

//element(*, app:Asset)[jcr:contains(., ‘image’)] in sql2 would look like
select [jcr:path] from [app:Asset] where contains(*, 'image')

//element(*, app:Asset)[jcr:contains(jcr:content/metadata/@format,
‘image’)] in sql2 would look like select [jcr:path] from [app:Asset] where
contains(jcr:content/metadata/format, 'image')

Basically, nodeScopeIndex does a fulltext search on the whole selected node
(that is the indexed property is indexed as if the node has the value being
indexed). Otoh, analyzed would do fulltext search on the property being
indexed itself.

All that said, could you please open a doc issue to improve the language
and add sql2 examples.

--Vikas
(sent from mobile)

Re: Lucene Index property Definitions

Posted by "jorgeeflorez ." <jo...@gmail.com>.
Thank you Vikas for your reply. I am searching using SQL-2  to create
queries, those examples don't look familiar to me. When I execute queries
here <http://oakutils.appspot.com/generate/index>, nodeScopeIndex is not
used so far.  Maybe if I dig into that syntax I will see the difference.

Jorge

El jue., 28 nov. 2019 a las 13:30, Vikas Saurabh (<vi...@gmail.com>)
escribió:

> On Thu, 28 Nov, 2019, 23:54 jorgeeflorez ., <jo...@gmail.com>
> wrote:
>
> > from the reference
> <
>
> https://jackrabbit.apache.org/oak/docs/query/lucene.html#property-definitions
> >,
> it is not clear to me the difference between the fields analyzed,
> nodeScopeIndex, both says that should be set when using *contains* in
> queries. But it is not clear the difference or the specific situation, I
> think. Any additional reference or explanation is appreciated.
>
> The details of each field have examples to show the difference. Pasting
> from the docs:
> -------
> nodeScopeIndex
>     Control whether the value of a property should be part of fulltext
> index. That is, you can do a jcr:contains(., ‘foo’) and it will return
> nodes that have a string property that contains the word foo. Example
>
>         //element(*, app:Asset)[jcr:contains(., ‘image’)]
>
> In case of aggregation all properties would be indexed at node level by
> default if the property type is part of includePropertyTypes. However if
> there is an explicit property definition provided then it would only be
> included if nodeScopeIndex is set to true.
>
> analyzed
>     Set this to true if the property is used as part of contains. Example
>
>         //element(*, app:Asset)[jcr:contains(type, ‘image’)]
>         //element(*, app:Asset)[jcr:contains(jcr:content/metadata/@format,
> ‘image’)]
> -----------
>
> --Vikas
> (sent from mobile)
>

Re: Lucene Index property Definitions

Posted by Vikas Saurabh <vi...@gmail.com>.
On Thu, 28 Nov, 2019, 23:54 jorgeeflorez ., <jo...@gmail.com>
wrote:

> from the reference
<
https://jackrabbit.apache.org/oak/docs/query/lucene.html#property-definitions
>,
it is not clear to me the difference between the fields analyzed,
nodeScopeIndex, both says that should be set when using *contains* in
queries. But it is not clear the difference or the specific situation, I
think. Any additional reference or explanation is appreciated.

The details of each field have examples to show the difference. Pasting
from the docs:
-------
nodeScopeIndex
    Control whether the value of a property should be part of fulltext
index. That is, you can do a jcr:contains(., ‘foo’) and it will return
nodes that have a string property that contains the word foo. Example

        //element(*, app:Asset)[jcr:contains(., ‘image’)]

In case of aggregation all properties would be indexed at node level by
default if the property type is part of includePropertyTypes. However if
there is an explicit property definition provided then it would only be
included if nodeScopeIndex is set to true.

analyzed
    Set this to true if the property is used as part of contains. Example

        //element(*, app:Asset)[jcr:contains(type, ‘image’)]
        //element(*, app:Asset)[jcr:contains(jcr:content/metadata/@format,
‘image’)]
-----------

--Vikas
(sent from mobile)