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 "Dirk Rudolph (JIRA)" <ji...@apache.org> on 2017/08/29 21:09:00 UTC
[jira] [Commented] (OAK-6597) rep:excerpt not working for content
indexed by aggregation in lucene
[ https://issues.apache.org/jira/browse/OAK-6597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16146126#comment-16146126 ]
Dirk Rudolph commented on OAK-6597:
-----------------------------------
This is because the property of node _/content/foo_, which is of the node type the index definition defines rules for, are added as stored fields using [LuceneDocumentMaker#indexProperty()|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java#L247] (See [LuceneDocumentMaker.java line 112-129|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java#L112]) and the properties of _/content/foo/jcr:content_ are added non-stored in [LuceneDocumentMaker#indexAggregatedNode()|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java#L599] (See [LuceneDocumentMaker.java line 652-658|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java#L652])
Is there any particular reason not to use {{indexProperty()}} for properties of the aggregated node?
> rep:excerpt not working for content indexed by aggregation in lucene
> --------------------------------------------------------------------
>
> Key: OAK-6597
> URL: https://issues.apache.org/jira/browse/OAK-6597
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: lucene
> Affects Versions: 1.6.1
> Reporter: Dirk Rudolph
> Attachments: excerpt-with-aggregation-test.patch
>
>
> I mentioned that properties that got indexed due to an aggregation are not considered for excerpts (highlighting) as they are not indexed as stored fields.
> See the attached patch that implements a test for excerpts in {{LuceneIndexAggregationTest2}}.
> It creates the following structure:
> {code}
> /content/foo [test:Page]
> + bar (String)
> - jcr:content [test:PageContent]
> + bar (String)
> {code}
> where both strings (the _bar_ property at _foo_ and the _bar_ property at _jcr:content_) contain different text.
> Afterwards it queries for 2 terms ("tinc*" and "aliq*") that either exist in _/content/foo/bar_ or _/content/foo/jcr:content/bar_ but not in both. For the former one the excerpt is properly provided for the later one it isn't.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)