Fixed bad URLs generated from page revisions and fixed wrong searches for attachments in page revisions.
Added some bad code that is necessary due to a bug in Whoosh<=2.5.1