def _convertToMongo(self, stamp): document = AMongoCollectionView._convertToMongo(self, stamp) searchBlurb = getSimplifiedTitle(stamp.entity.title) for content in stamp.contents: if content.blurb is not None: searchBlurb = "%s %s" % (searchBlurb, getSimplifiedTitle(content.blurb)) document['search_blurb'] = searchBlurb return document
def _convertToMongo(self, entity): if entity.entity_id is not None and entity.entity_id.startswith('T_'): del entity.entity_id document = AMongoCollection._convertToMongo(self, entity) if document is None: return None if 'title' in document: document['titlel'] = getSimplifiedTitle(document['title']) return document
def _convertToMongo(self, entity): if entity.entity_id is not None and entity.entity_id.startswith('T_'): del entity.entity_id # Extract search tokens searchTokens = generateSearchTokens(entity) # Convert document document = AMongoCollection._convertToMongo(self, entity) if document is None: return None # Add search tokens document['search_tokens'] = searchTokens # Add titlel if 'title' in document: document['titlel'] = getSimplifiedTitle(document['title']) return document