[1.7.x] Fixed #22812 -- Refactored lookup API documentation.

Thanks Anssi and Tim for reviews.

Backport of 8780849da0 from master