From cf795894b9290c5ab2035ae21535f0a7f4b7107a Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 16 Dec 2016 19:44:27 +0900 Subject: [PATCH] Fix #3246: xapian search adapter crashes --- CHANGES | 2 ++ sphinx/websupport/search/xapiansearch.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sphinx/websupport/search/xapiansearch.py b/sphinx/websupport/search/xapiansearch.py index 1e43dcb..aa7cff8 100644 --- a/sphinx/websupport/search/xapiansearch.py +++ b/sphinx/websupport/search/xapiansearch.py @@ -39,16 +39,16 @@ def finish_indexing(self): # Ensure the db lock is removed. del self.database - def add_document(self, path, title, text): + def add_document(self, pagename, filename, title, text): self.database.begin_transaction() # sphinx_page_path is used to easily retrieve documents by path. - sphinx_page_path = '"sphinxpagepath%s"' % path.replace('/', '_') + sphinx_page_path = '"sphinxpagepath%s"' % pagename.replace('/', '_') # Delete the old document if it exists. self.database.delete_document(sphinx_page_path) doc = xapian.Document() doc.set_data(text) - doc.add_value(self.DOC_PATH, path) + doc.add_value(self.DOC_PATH, pagename) doc.add_value(self.DOC_TITLE, title) self.indexer.set_document(doc) self.indexer.index_text(text)