You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2016/10/25 14:36:59 UTC

[jira] [Resolved] (OAK-4713) Builder class to simplify Lucene Index Definition building

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

Chetan Mehrotra resolved OAK-4713.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.5.13

Main parts done. Specific issues can be opened later on

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