Question 1: I have a tree-like data structure to search items, e.g.,
living creatures
/ \
bird fish
/ \ / \
canary Penguin
I am looking for a way to switch on/off the search results. For example, if bird is disabled, when a search is performed against the term "bird", bird and its children should not be appeared in the results. If bird is enabled, when the term "bird" is searched, bird (or bird and its children) should be appeared.
Question 2 Right now, I am putting this tree structure as a flatten list in the Elastic search as a field, what is the best way to make it a tree strucutre (I know I can use a nested fields but considering we have 30 levels depth and 100,000 children and most documents only have a few children.
Any comments are welcome.