fix references to search criteria to use ast table vars instead of constants