'Given a query spec, return an appropriate index in a form
suitable to be passed to Cursor.hint().'

def get_hint(self, spec):

    for (fieldname, hint) in viewitems(self.hint_indexes):
        if (fieldname in spec):
            return hint
