index and fix search bug