[3.8] Fix 1506 Avoid query error in case search engine index is broken