#1072 - Add query refinement API in the form of an extension handler
(cherry picked from commit 68df3b7)