diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-12-03 10:04:04 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-12-03 10:04:04 (GMT) |
commit | c452950d370c423200881c2fff59cc70931a153e (patch) | |
tree | a136ac933406b2ab5ea4c3d2ca2e3a3151a4a248 | |
parent | f723ecaea03f87223342591676841f2dd249cad7 (diff) |
Remove unused values from the index and make indexing a bit more robust
-rw-r--r-- | src/olpc/datastore/indexstore.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/olpc/datastore/indexstore.py b/src/olpc/datastore/indexstore.py index 1453f4c..47ba25b 100644 --- a/src/olpc/datastore/indexstore.py +++ b/src/olpc/datastore/indexstore.py @@ -27,10 +27,6 @@ from olpc.datastore.layoutmanager import MAX_QUERY_LIMIT _VALUE_UID = 0 _VALUE_TIMESTAMP = 1 -_VALUE_ACTIVITY_ID = 2 -_VALUE_MIME_TYPE = 3 -_VALUE_ACTIVITY = 4 -_VALUE_KEEP = 5 _PREFIX_UID = 'Q' _PREFIX_ACTIVITY = 'A' @@ -80,14 +76,11 @@ class IndexStore(object): def store(self, uid, properties): document = Document() document.add_term(_PREFIX_UID + uid) - document.add_term(_PREFIX_ACTIVITY + properties['activity']) + document.add_term(_PREFIX_ACTIVITY + properties.get('activity', '')) document.add_term(_PREFIX_MIME_TYPE + properties['mime_type']) document.add_value(_VALUE_UID, uid) document.add_value(_VALUE_TIMESTAMP, str(properties['timestamp'])) - document.add_value(_VALUE_ACTIVITY_ID, properties['activity_id']) - document.add_value(_VALUE_MIME_TYPE, str(properties['mime_type'])) - document.add_value(_VALUE_ACTIVITY, properties['activity']) term_generator = xapian.TermGenerator() |