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

Vikas Saurabh commented on OAK-4713:
------------------------------------

I like the idea... the patch looks good to me in terms of what's added. I was 
wondering though if we can probably try to see some useful use-cases from 
LucenePropIndexTest (or may be some other) to validate that we didn't miss 
anything (I don't feel we should convert them just yet... just that those would 
validate that it's covering the common cases).

> 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)

Reply via email to