diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-11-29 14:18:03 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-11-29 14:18:03 (GMT) |
commit | e23a6f66eb60abb8cee1990644ed3943947f02d8 (patch) | |
tree | 2fb4842d75b77947e4cdd81391f16e301cd26a82 | |
parent | 8557e8bbf7c9cf7f855dee9a8422c074f81539d8 (diff) |
#4662: Log a warning if a property in the model is supplied.
-rw-r--r-- | src/olpc/datastore/xapianindex.py | 29 |
1 files changed, 16 insertions, 13 deletions
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) |