It was something wrong with the file writing php function “file_put_contents”. I have managed to fix the issue, now it should work fine. I’ve added a picture into the “hello world” post and enabled post search, and the picture is in the result list, so it’s working fine.
I’m attaching the modified version, in case you need to reinstall the search.