generalize queryinput to allow multiple search templates