From e23a6f66eb60abb8cee1990644ed3943947f02d8 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 29 Nov 2007 14:18:03 +0000 Subject: #4662: Log a warning if a property in the model is supplied. --- diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py index 06041aa..d071eba 100644 --- a/src/olpc/datastore/xapianindex.py +++ b/src/olpc/datastore/xapianindex.py @@ -282,19 +282,22 @@ class IndexManager(object): external = kwargs.pop('external', False) xi = self.write_index.add_field_action - - if store: xi(key, secore.FieldActions.STORE_CONTENT) - if exact: xi(key, secore.FieldActions.INDEX_EXACT) - elif fulltext: - # weight -- int 1 or more - # nopos -- don't include positional information - # noprefix -- boolean - xi(key, secore.FieldActions.INDEX_FREETEXT, language=language, **kwargs) - - if sortable: - xi(key, secore.FieldActions.SORTABLE, type=type) - if collapse: - xi(key, secore.FieldActions.COLLAPSE) + + try: + if store: xi(key, secore.FieldActions.STORE_CONTENT) + if exact: xi(key, secore.FieldActions.INDEX_EXACT) + elif fulltext: + # weight -- int 1 or more + # nopos -- don't include positional information + # noprefix -- boolean + xi(key, secore.FieldActions.INDEX_FREETEXT, language=language, **kwargs) + + if sortable: + xi(key, secore.FieldActions.SORTABLE, type=type) + if collapse: + xi(key, secore.FieldActions.COLLAPSE) + except secore.IndexerError, e: + logging.warning('Could not add field %r: %s' % (key, e)) # track this to find missing field configurations self.fields.add(key) -- cgit v0.9.1