Make a filter on sub folders - I want to see the files inside the sub folder I selected

Dear Community,

I am a week old to Elasticsearch and trying to achieve a solution.

I have a folder say test with files and sub folders inside it.

test - folder
test1 - sub folder
test2 - sub folder
test3 - sub folder

I now want to make all test1, test2, test3, as values in a filed and make it searchable. So, I am trying to make the sub folders as filter values.

PS: I have indexed my root folder using fscrawler.

any help would be appreciated.

Thanks,
Manideep

I'm not sure what the question is.

Hi @dadoonet,

I have a root folder and sub folders inside the root folder. I want to filter on the sub folder to show only content specific to that sub folder.

Does this help?

Thanks,
Manideep

I guess it is. Look at the documents generated by FSCrawler.
You can run a search on it which matches any folder you want.

I have a path (real, virtual), But it is giving me the full path which i don't want.

Can I write a script to extract the folder name from the path?

Hi @dadoonet

I tried to extract the folder names using painless lang in kibana. however, I cannot use it in search query.

Any leads on how scripted fields can be used in search query?

PS:I cannot the same script in _source while writing the query. I just want to used the one already created.

Thanks,
Manideep

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