search token should match index token
remove some unnecessary code