Code

- Indexer Xapian, made Xapian 1.2 compatible. Needs at least Xapian 1.0.0 now.
authorber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 28 Jun 2010 12:52:10 +0000 (12:52 +0000)
committerber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 28 Jun 2010 12:52:10 +0000 (12:52 +0000)
  (Bernhard Reiter; Thanks to Olly Betts for providing the patch Issue2550647.)

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4484 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
doc/installation.txt
roundup/backends/indexer_xapian.py

index 29bb12738d2510ee6364d07381d228a2348635d9..8ff2df45e71da67569bd2037613c96de20ba976e 100644 (file)
@@ -13,6 +13,8 @@ Fixed:
 - Default to "text/plain" if no Content-Type header is present in email
   (thanks Hauke Duden)
 - Small documentation update regarding debugging aids (Bernhard Reiter)
 - Default to "text/plain" if no Content-Type header is present in email
   (thanks Hauke Duden)
 - Small documentation update regarding debugging aids (Bernhard Reiter)
+- Indexer Xapian, made Xapian 1.2 compatible. Needs at least Xapian 1.0.0 now.
+  (Bernhard Reiter; Thanks to Olly Betts for providing the patch Issue2550647.)
 
 
 2010-02-23 1.5.0
 
 
 2010-02-23 1.5.0
index d3cdf8e568e99ba5e2a94488ae07ac608634e77d..21753181614cca2bc3f34c8172031059a1ebe4a4 100644 (file)
@@ -69,9 +69,7 @@ Xapian full-text indexer
   installed and used. You will need to run the "roundup-admin reindex"
   command if the tracker has existing data.
 
   installed and used. You will need to run the "roundup-admin reindex"
   command if the tracker has existing data.
 
-  Roundup requires Xapian *newer* than 0.9.2 - it may be necessary for
-  you to install a snapshot. Snapshot "0.9.2_svn6532" has been tried
-  successfully.
+  Roundup requires Xapian 1.0.0 or newer.
 
 pyopenssl
   If pyopenssl_ is installed the roundup-server can be configured
 
 pyopenssl
   If pyopenssl_ is installed the roundup-server can be configured
@@ -85,7 +83,7 @@ pyme
   configured, you can require email to be cryptographically signed
   before roundup will allow it to make modifications to issues.
 
   configured, you can require email to be cryptographically signed
   before roundup will allow it to make modifications to issues.
 
-.. _Xapian: http://www.xapian.org/
+.. _Xapian: http://xapian.org/
 .. _pytz: http://www.python.org/pypi/pytz
 .. _Olson tz database: http://www.twinsun.com/tz/tz-link.htm
 .. _pyopenssl: http://pyopenssl.sourceforge.net
 .. _pytz: http://www.python.org/pypi/pytz
 .. _Olson tz database: http://www.twinsun.com/tz/tz-link.htm
 .. _pyopenssl: http://pyopenssl.sourceforge.net
index 38a7f2ee9d87cbd6075dcfa52522eb281a0a5442..385bcaecaa93cbbd9ddcd1f9f5ab54a7bfe01453 100644 (file)
@@ -24,7 +24,6 @@ class Indexer(IndexerBase):
         '''Save the changes to the index.'''
         if not self.transaction_active:
             return
         '''Save the changes to the index.'''
         if not self.transaction_active:
             return
-        # XXX: Xapian databases don't actually implement transactions yet
         database = self._get_database()
         database.commit_transaction()
         self.transaction_active = False
         database = self._get_database()
         database.commit_transaction()
         self.transaction_active = False
@@ -36,7 +35,6 @@ class Indexer(IndexerBase):
     def rollback(self):
         if not self.transaction_active:
             return
     def rollback(self):
         if not self.transaction_active:
             return
-        # XXX: Xapian databases don't actually implement transactions yet
         database = self._get_database()
         database.cancel_transaction()
         self.transaction_active = False
         database = self._get_database()
         database.cancel_transaction()
         self.transaction_active = False
@@ -59,7 +57,9 @@ class Indexer(IndexerBase):
 
         # open the database and start a transaction if needed
         database = self._get_database()
 
         # open the database and start a transaction if needed
         database = self._get_database()
-        # XXX: Xapian databases don't actually implement transactions yet
+
+        # XXX: Xapian now supports transactions, 
+        #  but there is a call to save_index() missing.
         #if not self.transaction_active:
             #database.begin_transaction()
             #self.transaction_active = True
         #if not self.transaction_active:
             #database.begin_transaction()
             #self.transaction_active = True
@@ -77,9 +77,8 @@ class Indexer(IndexerBase):
         query = xapian.Query(xapian.Query.OP_AND, [identifier])
         enquire.set_query(query)
         matches = enquire.get_mset(0, 10)
         query = xapian.Query(xapian.Query.OP_AND, [identifier])
         enquire.set_query(query)
         matches = enquire.get_mset(0, 10)
-        if matches.size():      # would it killya to implement __len__()??
-            b = matches.begin()
-            docid = b.get_docid()
+        if len(matches):
+            docid = matches[0].docid
         else:
             docid = None
 
         else:
             docid = None