when searching is turned on, we need to make sure the filtering indices `i` are smaller than nrow(filtered data) instead of original data

this fixes the bug reported at https://groups.google.com/forum/#!topic/shiny-discuss/xk2Gh7KJQBM