Hi,
When I tried to run the command "bhsearch rebuild", I got the message:
KeyError: 'product'
After this error, the search stopped to work as the index is no longer
there.
Looking into the log, I found out the following stacktrace:
2014-02-28 16:52:05,770 Trac[console] ERROR: Exception in trac-admin
command:
Traceback (most recent call last):
File "/home/bloodhound/0.7/trac/trac/admin/console.py", line 109,
in onecmd
rv = cmd.Cmd.onecmd(self, line) or 0
File "/usr/lib/python2.7/cmd.py", line 220, in onecmd
return self.default(line)
File "/home/bloodhound/0.7/trac/trac/admin/console.py", line 285,
in default
return cmd_mgr.execute_command(*args)
File "/home/bloodhound/0.7/trac/trac/admin/api.py", line 124, in
execute_command
return f(*fargs)
File "/home/bloodhound/0.7/bloodhound_search/bhsearch/api.py",
line 344, in rebuild_index
doc['product'],
KeyError: 'product'
Following it, I found out that the cause of the problem is related to an
attempt to log a debug message with the statement:
self.log.debug(
"Indexing document %s:%s/%s" % (
doc['product'],
doc['type'],
doc['id'],
)
)
It appears that doc['product'] does not exist as a named key for the
dictionary doc for at least one document.
I didn't had time to create a proper fix so, as a workaround, I removed
the statement and the "bhsearch rebuild" command started to work as
expected.
I would like to know how can I create a BH account in the project's page
to report other issues I found in the current version.
Best regards,
Fabio Chino