If you get an instance of IClient, there's an "Index()" method which accepts individual pages or a list of pages to index. If you know the parent item, getting the children (or descendants) is quite straightforward using the IContentLoader so you could pass the page and its children/descendents into the Index method.
Rather than an admin plugin, I think this would work better as a context menu item on the items in the tree.
For older version pre cms12 there has been a couple of plugins helping you with this issues like: GitHub - BVNetwork/InspectInIndex: A quick and easy way to inspect EPiServer content in the EPiServer Find index
This will reindex and you can also view you data as json directly in the cms. Most likely possible to update to cms 12 if needed.
Another nice tool is this from Geta that has the feature you are requesting for indexing child-items as well: Geta.Epi.IndexContentInFind, GitHub - Geta/Epi.IndexContentInFind: Tool to index content items in Episerver Find. Makes it possible to index a single item or an item including it's descendents.
We have use both from time to time and saves a lot of time when you need to reindex parts of your solution in a multisite scenario.
Ah yes. I knew I'd seen something like that before. I think I've seen both of those in use on projects before. Very handy.
Hello.
Is there any way where I can re-index a single page and all its children? I am thinking of making, maybe an admin plugin, where user can add a page id and then it re-indexes with all its children?
I found this https://world.optimizely.com/blogs/ravindra-s--rathore/dates/2019/9/reindex-a-target-site-in-episerver-find--admin-tool/ but it is for sites. I don't want full site but a sub-section