[
https://issues.apache.org/jira/browse/OAK-3576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15066364#comment-15066364
]
Chetan Mehrotra commented on OAK-3576:
--------------------------------------
Patch looks better!. Some minor points
# Use of _defn.getVersion().isAtLeast(IndexFormatVersion.V2))_ in
{{LuceneIndexEditor}} - You can drop this check. Even if you were dealing with
older index then also you are not changing semantics of existing Lucene index
fields. So any change done is compatible
# Add {{CheckForNull}] or {{Nullable}} annotation to SPI interfaces - This
conveys what is expected and what not. Prefer non null value in most cases. So
you can mark {{getAugmentedFields}} to always return some value. In case no
field is return document it to return an emptyList
* If possible reduce use of null check - Ensure that IndexAugmentorFactory
always returns a List. If no provider is registered against a particular type
then use emptyList. Further within CompositeIndexFieldProvider you can still
deal with null return from {{IndexFieldProvider}} but you return an empty list.
So in {{LuceneIndexEditor}} you can again drop the null check. Lesser null
checks make code readable!
Further updates we can do post commit also
> Allow custom extension to augment indexed lucene documents
> ----------------------------------------------------------
>
> Key: OAK-3576
> URL: https://issues.apache.org/jira/browse/OAK-3576
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Vikas Saurabh
> Assignee: Vikas Saurabh
> Fix For: 1.4
>
> Attachments: OAK-3576.jsedding.patch, OAK-3576.take2.patch,
> OAK-3576.wip.patch
>
>
> Following up on http://oak.markmail.org/thread/a53ahsgb3bowtwyq, we should
> have an extension point in oak to allow custom code to add fields to
> documents getting indexed in lucene. We'd also need to allow extension point
> to add extra query terms to utilize such augmented fields.
> (cc [~teofili], [~chetanm])
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)