Logo Search packages:      
Sourcecode: zeitgeist-extensions version File versions  Download package

def fts::Indexer::_delete_event_real (   self,
  event_id 
) [private]

Look up the doc id given an event id and remove the xapian.Document
for that doc id.
Note: This is slow, but there's not much we can do about it

Definition at line 316 of file fts.py.

00316                                              :
            """
            Look up the doc id given an event id and remove the xapian.Document
            for that doc id.
            Note: This is slow, but there's not much we can do about it
            """
            try:
                  _id = xapian.sortable_serialise(float(event_id))
                  query = xapian.Query(xapian.Query.OP_VALUE_RANGE, 
                                       VALUE_EVENT_ID, _id, _id)
                  
                  self._enquire.set_query (query)
                  hits = self._enquire.get_mset (0, 10)
                  
                  total = hits.get_matches_estimated()
                  if total > 1:
                        log.warning ("More than one event found with id '%s'" % event_id)
                  elif total <= 0:
                        log.debug ("No event for id '%s'" % event_id)
                        return
            
                  for m in hits:
                        log.debug("Deleting event '%s' with docid '%s'" %
                                  (event_id, m.docid))
                        self._index.delete_document(m.docid)
            except Exception, e:
                  log.error("Failed to delete event '%s': %s" % (event_id, e))
            
      def _split_uri (self, uri):


Generated by  Doxygen 1.6.0   Back to index