1. Matt Chaput
  2. whoosh
  3. Issues
Issue #208 resolved

PyStemmer and caching

Jan Schrewe
created an issue

When I trie to use PyStemmer with whoosh 2.3.0 I get the following error:



Traceback (most recent call last): File "<console>", line 1, in <module> File "/Users/jschrewe/webdesign/wickelkinder/apps/search/init.py", line 18, in autodiscover import_module('%s.%s' % (app, 'search')) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/Users/jschrewe/webdesign/wickelkinder/apps/magazin/search.py", line 23, in <module> sitesearch.register(Post, PostSchema) File "/Users/jschrewe/webdesign/wickelkinder/apps/search/sitesearch.py", line 26, in register if index.exists_in(self.index_dir, indexname=index_name): File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/index.py", line 128, in exists_in ix = open_dir(dirname, indexname=indexname) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/index.py", line 114, in open_dir return storage.open_index(indexname) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/filedb/filestore.py", line 65, in open_index return FileIndex(self, schema=schema, indexname=indexname) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/filedb/fileindex.py", line 240, in init _read_toc(self.storage, self._schema, self.indexname) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/filedb/fileindex.py", line 161, in _read_toc schema = pickle.loads(stream.read_string()) File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/analysis.py", line 914, in setstate self.clear() File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/whoosh/analysis.py", line 920, in clear self._stem = lru_cache(self.cachesize)(self.stemfn) AttributeError: 'PyStemmerFilter' object has no attribute 'stemfn' }}}

I woud try to fix it, but I'm not really sure what's supposed to happen here. Does PyStemmer not work with caching?

Comments (2)

  1. Matt Chaput repo owner

    Hi, this is fixed in the cleanup2.4 branch; I'm going to try to do a "2.4" release tomorrow or so with all the fixes that have built up in the past couple of months while I've been too busy to work on Whoosh. Thanks very much!

  2. Log in to comment