Fixed twice or more consecutive query to sphinx

see #4830.