I realized now that I logged an issue for this recently OAK-5511 which mentioned similar approach. So lets move this discussion there Chetan Mehrotra
On Thu, Feb 23, 2017 at 7:06 PM, Thomas Mueller <[email protected]> wrote: > Hi, > >>I like Marcel proposal for "enforcing" use of mixin on parent node to >>indicate that it can have a child node of 'oak:index'. So we can >>leverage mxin 'mix:indexable' (OAK-3725) to mark such parent nodes >>(like root) and IndexUpdate would only look for 'oak:index' node if >>current node has that mixin. > > Ah I didn't know about OAK-3725. > > I'm a bit worried that we mix different aspects together, not sure which > is better. > > "oak:Indexable" is visible, so it can be added and _removed_ by the user. > So when trying to remove that mixin, we would need to check there is no > oak:index child node with nodetype oak:QueryIndexDefinition. We need to > check the nodetype hierarchy. On the other hand, possibly we can enforce > that the parent node of oak:index is oak:Indexable (can we?) > > I'm not saying with a hidden property hidden property ":hasOakIndex" > (automatically set and removed) it would be painless. For example when > moving an oak:index node to a new parent, the setting has to be changed at > both the original and the new parents. > > Regards, > Thomas > >
