added match counter for searching a doc