class allura.model.session.BatchIndexer(session)

Tracks needed search index operations over the life of a ming.odm.session.ThreadLocalODMSession session, and performs them in a batch when flush() is called.

classmethod flush()

Creates indexing tasks for cached adds and deletes, and resets the caches.


This method is NOT called automatically when the parent session is flushed. It MUST be called explicitly.

update_index(objects_deleted, arefs_added)

Caches adds and deletes for handling later. Called after each flush of the parent session.

  • objects_deletedallura.model.artifact.Artifact instances that were deleted in the flush.
  • arefs_addedallura.model.artifact.ArtifactReference instances for all Artifact instances that were added or modified in the flush.
class allura.model.session.ExplicitFlushOnlySessionExtension(session)

Used to avoid auto-flushing objects after merely creating them.

Only save them when we really want to by calling flush(obj) or setting obj.explicit_flush = True


Before the session is flushed for obj

If obj is None it means all the objects in the UnitOfWork which can be retrieved by iterating over ODMSession.uow

allura.model.session.substitute_extensions(*args, **kwds)

Temporarily replace the extensions on a ming.odm.session.ThreadLocalODMSession session.