Multiple Level with Parent Child Relation

Hi I am new to elasticsearch and I am trying to map a folder structure that I want to search.
My folders can have any number of subfolders and any number of files. Later I want to be able to search all children from the view of one folder.

Example: id1-> id2 ->id3 -> id4
when i am in folder id2 and want to search from here. Here I am looking for all files with the tags tag2 and tag5.

I think I should use the Parent Child Relation. Unfortunately I can't get the joins right, currently kibana always says "No cached mapping for this field". Updating the pattern will not fix this.

I have used the generated index mapping from elasticsearch, as well as an manually generated one.

PUT folders
"mappings" : {
"properties" : {
"children" : {
"type": "join",
"relations": {
"folders": "folders"
"id" : {
"type" : "long"

but nothing was working. could someone please tell me how to make this happen?
thanks a lot in advance.


I'm not going to answer the title of your thread about parent/child but a way I built a directory map in the past.

It's here:

Basically I'd use a path tokenizer as explained in the blog post.
But I'd not use any parent/child feature.

BTW please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:


This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.