Commits

Georg Brandl committed 3f6e90b

Use different Whoosh API in order to fix test failure.

  • Participants
  • Parent commits cc389b7

Comments (0)

Files changed (1)

File sphinx/websupport/search/whooshsearch.py

 
 from whoosh import index
 from whoosh.fields import Schema, ID, TEXT
+from whoosh.qparser import QueryParser
 from whoosh.analysis import StemmingAnalyzer
 
 from sphinx.util.osutil import ensuredir
             self.index = index.open_dir(db_path)
         else:
             self.index = index.create_in(db_path, schema=self.schema)
+        self.qparser = QueryParser('text', self.schema)
 
     def init_indexing(self, changed=[]):
         for changed_path in changed:
 
     def handle_query(self, q):
         searcher = self.index.searcher()
-        whoosh_results = searcher.find('text', q)
+        whoosh_results = searcher.search(self.qparser.parse(q))
         results = []
         for result in whoosh_results:
             context = self.extract_context(result['text'])