web2py-haystack
web2py-haystack copied to clipboard
Fix whoosh, PY3 compat and PEP8
Whoosh was actually always recreating the index and losing what was previously indexed because it was missing the open_dir import and so it always triggered the except clause and used create_in.
Improvements to whoosh. Allow optional definition of fields in "indexes". Allow setting a custom_writer, this is needed if you're going to insert a bunch of stuff in a batch and don't want to be commiting for each item.
Also Made it PYTHON3 compatible and PEP8 compliant.
I realize this is a pretty big commit but I was making the changes as I needed them.