[ 
https://issues.apache.org/jira/browse/OAK-4713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra updated OAK-4713:
---------------------------------
    Description: 
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();

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

  was:
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();

builder.build(); //Returns NodeState
builder.build(tree); //Copies the definition to tree
builder.build(node); //Copies the definition to JCR Node
{code}


> 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: New Feature
>          Components: lucene
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.6
>
>
> 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();
> 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