Indicesmanager: bugfix: add use for Exception.
Query: add abstract base class.