Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
My apologies. I had both over-analyzed and under-analyzed what the argument handler should accomplish here. It still extends the base relational argument handler class, since we want the built-in capability of resolving nested relational arguments there, but the handleArgument method already returns the specific element ids we're after. I rewrote the class to fit the purpose and tested it. You can find it here: I rewrote that one file here: gist.github.com/andris-sevcenko/…
Something like $relatedIds = MatrixBlock::find()->select('ownerId')->column(); should return what you're after. (MatrixBlock should be an alias of \craft\elements\MatrixBlock).
Just a custom argument handler. The ids you return (provided you extend the RelationArgumentHandler class) are going to get included in the relatedTo argument. So, run your search based on the argument value. That will get you entry ids. Since Craft doesn't have the concept of reverse relations, you'll have to do another search to find the Matrix Blocks that are related to the entries with the ids you have. After that, you should return the ids of all the Matrix Blocks and, as they get rolled in the relatedTo argument, you get a list of the entries related to the Matrix Blocks.
I mean when you run the indexing process, your Craft install fires a bunch of Ajax requests to the server to try to index the files. Can you check the response body of those requests? If all seems normal, maybe enable devMode and try again.