my PHP skills are next to none, but if you dont clear out that params
array, dont you try to execute the search operation with exactly the same
as the index operation (which will very likely fail, as id is not a valid
parameter for a search, as mentioned in the error message)?