Skip to content

Instantly share code, notes, and snippets.

@guirenard
Created December 17, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guirenard/60288dd2b13f6376ae56 to your computer and use it in GitHub Desktop.
Save guirenard/60288dd2b13f6376ae56 to your computer and use it in GitHub Desktop.
def splitPath = [];
splitPath = ctx._source['ecm:path'].split('/');
ctx._source['pathDepth'] = splitPath.length;
for (i = 1; splitPath.length > i; i++) {
ctx._source['pathLevel' + i] =splitPath[i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment