added match function definition to search.js