While working on an intranet with on of our clients in the APAC region, we discovered that private pages are not indexed correctly, thus having issues when searching content. Product team is already aware of this and have already logged a ticket here. While adding features to Liferay is all good and well, we don't have the time to wait for the product team, and thus this workaround was created. However, I'd still recommend using the solution provided by product team over this workaround once that becomes available.
Why aren't private pages searchable?
Private pages are not indexed properly since the layout crawler responsible for them uses Guest user access.
So the workaround is a custom module that you deploy to your Liferay workspace. Below are the steps we did during development.
The source code contains 3 major files
You can find the source code here and the steps on how to set it up here.
I would like to thank Ha Tang for coming up with this brilliant idea and implementing it for our client. As always, constructive feedback is appreciated.