Changes to test.py to take search index and keyword as argument