[
https://issues.apache.org/jira/browse/OAK-4713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15445429#comment-15445429
]
Chetan Mehrotra commented on OAK-4713:
--------------------------------------
Thanks for looking. Current implementation was done based on test requirement
only!. Further once we have a base implementation seeded in enhancing it later
as per requirement would be much more easier
> Builder class to simplify Lucene Index Definition building
> ----------------------------------------------------------
>
> Key: OAK-4713
> URL: https://issues.apache.org/jira/browse/OAK-4713
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Chetan Mehrotra
> Assignee: Chetan Mehrotra
> Priority: Minor
> Fix For: 1.6
>
> Attachments: OAK-4713-v1.patch
>
>
> Currently there are various ways to build Lucene index definition. The
> approach varies from code to code and at level they are working. Like test
> case working at NodeState api, Tree api or higher level Jcr api. To simplify
> creating index definition I would like to add a builder class.
> *Usage*
> {code}
> IndexDefinitionBuilder builder = new IndexDefinitionBuilder();
> builder.indexRule("nt:base")
> .property("foo")
> .ordered()
> .enclosingRule()
> .property("bar")
> .analyzed()
> .propertyIndex()
> .enclosingRule()
> .property("baz")
> .propertyIndex();
> //Defining aggregate rules
> builder.aggregateRule("cq:Page").include("jcr:content").relativeNode();
> builder.aggregateRule("dam:Asset", "*", "*/*");
> builder.build(); //Returns NodeState
> builder.build(tree); //Copies the definition to tree
> builder.build(node); //Copies the definition to JCR Node
> {code}
> The builder was being used so far in oakutils [1]
> [1]
> https://github.com/chetanmeh/oakutils/blob/master/src/main/java/com/chetanmeh/oak/index/config/IndexDefinitionBuilder.java
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)