Skip to content

Commit afc7f43

Browse files
author
Ralf Schlatterbeck
committed
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.
1 parent c7c7850 commit afc7f43

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

roundup/hyperdb.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
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 $
1919

2020
"""Hyperdatabase implementation, especially field types.
2121
"""
@@ -1324,12 +1324,14 @@ def import_files(self, dirname, nodeid):
13241324
shutil.copyfile(source, dest)
13251325

13261326
mime_type = None
1327-
if self.getprops().has_key('type'):
1327+
props = self.getprops()
1328+
if props.has_key('type'):
13281329
mime_type = self.get(nodeid, 'type')
13291330
if not mime_type:
13301331
mime_type = self.default_mime_type
1331-
self.db.indexer.add_text((self.classname, nodeid, 'content'),
1332-
self.get(nodeid, 'content'), mime_type)
1332+
if props['content'].indexme:
1333+
self.db.indexer.add_text((self.classname, nodeid, 'content'),
1334+
self.get(nodeid, 'content'), mime_type)
13331335

13341336
class Node:
13351337
''' A convenience wrapper for the given node

0 commit comments

Comments
 (0)