[Doc] Java API: add search templates

Closes #7321.

(cherry picked from commit ee108e5)