fix set index and type for search correctly