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

Vikas Saurabh commented on OAK-3576:
------------------------------------

Had offline discussion with [~chetanm] and [~teofili]. Here's a gist of what 
was discussed:
* All registered augmentors would get callbacks. It's upto the implementation 
to decide to quit early.
* Instead of a map like interface to expose to custom augmentors, we would pass 
{{NodeState}} of index definition. The implementation is free to choose how to 
decide whether it should add fields or not
** This requires OAK-3785
* Expose a configuration for {{PropertyDefinition}} to control whether OOTB 
fields should be added for a given property or not (OAK-3789)
** This was needed as the current patch worked iff the specific node which was 
being indexed was changed in a diff process. A sub-property change wasn't 
triggerring index
* For query side extension, it's fine to just expose full text query terms.

I've pushed current state at 
[index-augment|https://github.com/catholicon/jackrabbit-oak/tree/index-augment] 
branch of my fork. Please review and comment (here :) ). Apart from commits for 
2 issues mentioned above, the rest of the change is in this 
[commit|https://github.com/catholicon/jackrabbit-oak/commit/0f877efae74a0f32da77d49cd1df680a0cfc726e].

There are 2 SPI exposed now:
* {{IndexFieldProvider}} - has a method {{List<Field> getAugmentedFields(final 
String path, final String propertyName, final NodeState document, final 
PropertyState property, final NodeState indexDefinition)}}
* {{FulltextQueryTermsProvider}} - has a method {{Query getQueryTerm(final 
String text, final Analyzer analyzer)}}

I'd adding some more tests and logs in the mean time.

(cc [~jsedding])

> 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
>         Attachments: OAK-3576.jsedding.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)

Reply via email to