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 2017/07/19 10:03:00 UTC

[jira] [Commented] (OAK-6471) Support adding or updating index definitions via oak-run

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

Chetan Mehrotra commented on OAK-6471:
--------------------------------------

Had a discussion with [~mreutegg] on a possible approach.

The index definition is provided as JSON. 

{code}
{
 "/oak:index/lucene": {
    "jcr:primaryType": "oak:QueryIndexDefinition",
    "compatVersion": 2,
    "type": "lucene",
    "async": ["fulltext-async"],
    ...
    "indexRules": {
      "jcr:primaryType": "nt:unstructured",
      "rep:Token": {
        "jcr:primaryType": "nt:unstructured",
        "properties": {
          "jcr:primaryType": "nt:unstructured"
        }
      },
    }
  }
  "/oak:index/slingeventJob": {
    "jcr:primaryType": "oak:QueryIndexDefinition",
    "compatVersion": 2,
    "includedPaths": ["/var/eventing"],
    ...
    }
}
{code}

# Here each key is indexPath and value index definition in json
# Oak Index Definition only use the basic types - String, Long and Double. So they map directly to JSON
# For Binary property we only support jcr:data whose value is interpreted as a relative file name

This json would then be internally converted to NodeState and applied to in memory CopyOnWriteNodeStore implementation and later would also be used by import logic to apply it back to NodeBuilder

This would also allow us to consume output of http://oakutils.appspot.com/generate/index easily. 

[~catholicon] [~tmueller] Thoughts?

> Support adding or updating index definitions via oak-run
> --------------------------------------------------------
>
>                 Key: OAK-6471
>                 URL: https://issues.apache.org/jira/browse/OAK-6471
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: indexing, run
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.8
>
>
> Currently oak-run can be used to reindex an existing index present in NodeStore. I would like to extend this feature set to support adding or updating the index definition and then reindexing them. The end user story would be like below
> Development team updates or introduces a new index definition and gives it to system admin. Then admin can use oak-run and give it reference to the index definition and then tooling takes care of indexing (with read only mode) and then importing the updated index definition back into the repository.
> To start with the index definitions would be provided as a json file with a single json file containing index definitions which needs to be reindexed. The file format would be similar to one we used for dumping index definition (OAK-6224). 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)