index 38a7f2ee9d87cbd6075dcfa52522eb281a0a5442..385bcaecaa93cbbd9ddcd1f9f5ab54a7bfe01453 100644 (file)
'''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
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
# 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
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