optimize build index, search