Fix #1503 : Avoid query error in case search engine index is broken
Merge pull request #675 from romainneutron/fix-1506

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