You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/01/21 07:23:34 UTC

[jira] [Commented] (OAK-2426) [LucenePropertyIndex] full-text search on first level relative node returns no result

    [ https://issues.apache.org/jira/browse/OAK-2426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14285237#comment-14285237 ] 

Chetan Mehrotra commented on OAK-2426:
--------------------------------------

Thanks for the testcase!. The issue was happening because aggregation with relativeNode include was working only for the cases where new aggregation rules are applicable on the node being aggregated. For e.g. if we have a reativeNode include for {{jcr:content}} and that node happens to be a be a {{nt:file}} then aggregation logic would fetch the new aggregation rule of {{nt:file}} and would apply that. However there are no other aggregation rule defined then current logic was failing.

This has been fixed now and aggregation logic also aggregate the current node which is matched by an include rule with relativeNode set to true

Done a fix with

* trunk - http://svn.apache.org/r1653446
* 1.0 - http://svn.apache.org/r1653447

[~amitjain] Can you check if the fix works for your case. The testcase at least passes

> [LucenePropertyIndex] full-text search on first level relative node returns no result
> -------------------------------------------------------------------------------------
>
>                 Key: OAK-2426
>                 URL: https://issues.apache.org/jira/browse/OAK-2426
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-lucene
>    Affects Versions: 1.0.9, 1.1.4
>            Reporter: Amit Jain
>            Assignee: Chetan Mehrotra
>             Fix For: 1.0.10, 1.1.6
>
>         Attachments: OAK-2426.patch
>
>
> Following query does not return any result even with a proper index defined [1].
> {noformat}//element(*, test:Page)[ " +
>             "jcr:contains(jcr:content, 'summer') ]
> {noformat}
> [1]
> {code}
> {
>   "jcr:primaryType": "oak:QueryIndexDefinition",
>   "compatVersion": 2,
>   "name": "pageIndex",
>   "type": "lucene",
>   "async": "async",
>   "reindex": true,
>   "aggregates": {
>     "jcr:primaryType": "nt:unstructured",
>     "test:Page": {
>       "jcr:primaryType": "nt:unstructured",
>       "include0": {
>         "jcr:primaryType": "nt:unstructured",
>         "relativeNode": true,
>         "path": "jcr:content"
>       }
>     }
>   },
>   "indexRules": {
>     "jcr:primaryType": "nt:unstructured",
>     "test:Page": {
>       "jcr:primaryType": "nt:unstructured",
>       "properties": {
>         "jcr:primaryType": "nt:unstructured",
>         "jcr:lastModified": {
>           "jcr:primaryType": "nt:unstructured",
>           "ordered": true,
>           "propertyIndex": true,
>           "name": "jcr:content/jcr:lastModified",
>           "type": "Date"
>         }
>       }
>     }
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)