Fix for Whoosh >= 2.5
make whoosh fix work for all versions