diff --git a/themis/search/indexer.py b/themis/search/indexer.py index e1b9d77..4e24f3c 100644 --- a/themis/search/indexer.py +++ b/themis/search/indexer.py @@ -153,7 +153,10 @@ def contactIndexer(obj): v = v[0] if ':' in v: src = ContactsSource() - r = src.fastGetTitleByToken(obj, v) + try: + r = src.fastGetTitleByToken(obj, v) + except KeyError: + continue if not type(r) is unicode: r = unicode(r, 'utf-8') return r @@ -176,7 +179,10 @@ def contactFuzzyIndexer(obj): v = v[0] if ':' in v: src = ContactsSource() - r = src.fastGetTitleByToken(obj, v) + try: + r = src.fastGetTitleByToken(obj, v) + except KeyError: + return v.split(':')[1:] if not type(r) is unicode: r = unicode(r, 'utf-8') return r