Commits

Thomas Waldmann committed 3b1de2b

search/indexing: enable the query parser RegexPlugin, remove a workaround for a fixed whoosh issue

Comments (0)

Files changed (1)

MoinMoin/storage/middleware/indexing.py

                     itemid = searcher.stored_fields(docnum_remove)[ITEMID]
             if docnum_remove is not None:
                 # we are removing a revid that is in latest revs index
-                try:
-                    latest_names_revids = self._find_latest_names_revids(self.ix[ALL_REVS], Term(ITEMID, itemid))
-                except AttributeError:
-                    # workaround for bug #200 AttributeError: 'FieldCache' object has no attribute 'code'
-                    latest_names_revids = []
+                latest_names_revids = self._find_latest_names_revids(self.ix[ALL_REVS], Term(ITEMID, itemid))
                 if latest_names_revids:
                     # we have a latest revision, just update the document in the index:
                     assert len(latest_names_revids) == 1 # this item must have only one latest revision
             qp = QueryParser(default_fields[0], schema=schema)
         else:
             raise ValueError("default_fields list must at least contain one field name")
-        # TODO before using the RegexPlugin, require a whoosh release that fixes whoosh issues #205 and #206
-        #qp.add_plugin(RegexPlugin())
+        qp.add_plugin(RegexPlugin())
         def username_pseudo_field(node):
             username = node.text
             users = user.search_users(**{NAME_EXACT: username})