Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 3802:c3af8c6a6b5b
Bug-fix: Only index the content property if it has the indexme attribute set
This attribute was only recently introduced for the content property
(previously it was always indexed). This fixes *huge* increasing
import times for me.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Jan 2007 18:17:00 +0000 |
| parents | e754cc14e76a |
| children | 21d3d7eeea8c |
comparison
equal
deleted
inserted
replaced
| 3801:0ada7d57b9ea | 3802:c3af8c6a6b5b |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: hyperdb.py,v 1.128 2006-11-09 03:08:22 richard Exp $ | 18 # $Id: hyperdb.py,v 1.129 2007-01-10 18:17:00 schlatterbeck Exp $ |
| 19 | 19 |
| 20 """Hyperdatabase implementation, especially field types. | 20 """Hyperdatabase implementation, especially field types. |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 1322 dest = self.db.filename(self.classname, nodeid, create=1) | 1322 dest = self.db.filename(self.classname, nodeid, create=1) |
| 1323 ensureParentsExist(dest) | 1323 ensureParentsExist(dest) |
| 1324 shutil.copyfile(source, dest) | 1324 shutil.copyfile(source, dest) |
| 1325 | 1325 |
| 1326 mime_type = None | 1326 mime_type = None |
| 1327 if self.getprops().has_key('type'): | 1327 props = self.getprops() |
| 1328 if props.has_key('type'): | |
| 1328 mime_type = self.get(nodeid, 'type') | 1329 mime_type = self.get(nodeid, 'type') |
| 1329 if not mime_type: | 1330 if not mime_type: |
| 1330 mime_type = self.default_mime_type | 1331 mime_type = self.default_mime_type |
| 1331 self.db.indexer.add_text((self.classname, nodeid, 'content'), | 1332 if props['content'].indexme: |
| 1332 self.get(nodeid, 'content'), mime_type) | 1333 self.db.indexer.add_text((self.classname, nodeid, 'content'), |
| 1334 self.get(nodeid, 'content'), mime_type) | |
| 1333 | 1335 |
| 1334 class Node: | 1336 class Node: |
| 1335 ''' A convenience wrapper for the given node | 1337 ''' A convenience wrapper for the given node |
| 1336 ''' | 1338 ''' |
| 1337 def __init__(self, cl, nodeid, cache=1): | 1339 def __init__(self, cl, nodeid, cache=1): |
