Commits

Thomas Waldmann committed 3183a20

fix searchform

  • Participants
  • Parent commits d90218b
  • Branches storage-ng

Comments (0)

Files changed (2)

MoinMoin/apps/frontend/views.py

         history = bool(request.values.get('history'))
         qp = flaskg.storage.query_parser([NAME_EXACT, NAME, CONTENT], all_revs=history)
         q = qp.parse(query)
-        with flaskg.storage.searcher(all_revs=history) as searcher:
+        with flaskg.storage.get_index(all_revs=history).searcher() as searcher:
             flaskg.clock.start('search')
             results = searcher.search(q, limit=100)
             flaskg.clock.stop('search')
                               data_rendered=Markup(item._render_data()),
                               show_revision=show_revision,
                               show_navigation=show_navigation,
-                              #search_form=SearchForm.from_defaults(),
+                              search_form=SearchForm.from_defaults(),
                              )
     return Response(content, status)
 
     """
     q = And([Term(WIKINAME, app.cfg.interwikiname),
              Or([Term(ITEMTRANSCLUSIONS, item_name), Term(ITEMLINKS, item_name)])])
-    docs = flaskg.storage.search(q, all_revs=False)
+    docs = flaskg.storage.get_index(all_revs=False).search(q)
     return [doc[NAME] for doc in docs]
 
 

MoinMoin/storage/middleware/protecting.py

         else:
             raise ValueError('No acl_mapping entry found for item %r' % itemname)
 
+    def get_index(self, all_revs=False):
+        return self.indexer.get_index(all_revs=all_revs)
+
+    def query_parser(self, default_fields, all_revs=False):
+        return self.indexer.query_parser(default_fields, all_revs=False)
+
     def search(self, q, all_revs=False, **kw):
         for rev in self.indexer.search(q, all_revs, **kw):
             rev = ProtectedRevision(self, rev)