Roundup Tracker - Issues

Issue 666767

classification
Full text searching on python 2.2
Type: Severity: normal
Components: Web interface Versions:
process
Status: closed fixed
:
: richard : richard
Priority: normal :

Created on 2003-01-12 19:45 by anonymous, last changed 2003-01-16 05:56 by richard.

Messages
msg586 Author: [hidden] (anonymous) Date: 2003-01-12 19:45
I've got a problem when performing full-text search.
The issue was noticed in  roundup 0.5.4 on python2.2.
Not all searches fail, but only with particular words...

When I trying to search with something entered in "All
text" field, I get this traceback:

======8<=================================

A problem occurred in your template "issue.index". 
Full traceback: 
Traceback (most recent call last):
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/client.py", line 368, in renderContext
    return pt.render(self, None, None, **args)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/templating.py", line 187, in render
    getEngine().getContext(c), output, tal=1, 
strictinsert=0)()
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 154, in 
__call__
    self.interpret(self.program)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 186, in 
interpret
    handlers[opcode](self, args)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 525, in 
do_useMacro
    self.interpret(macro)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 186, in 
interpret
    handlers[opcode](self, args)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 345, in 
do_optTag_tal
    self.do_optTag(stuff)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 330, in 
do_optTag
    return self.no_tag(start, program)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 325, in 
no_tag
    self.interpret(program)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 186, in 
interpret
    handlers[opcode](self, args)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 549, in 
do_defineSlot
    self.interpret(slot)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 186, in 
interpret
    handlers[opcode](self, args)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/TAL/TALInterpreter.py", line 402, in 
do_setLocal_tal
    self.engine.setLocal(name, self.engine.evaluateValue
(expr))
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/PageTemplates/TALES.py", line 225, in 
evaluate
    v = expression(self)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/PageTemplates/Expressions.py", line 
188, in __call__
    return self._eval(econtext)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/PageTemplates/Expressions.py", line 
183, in _eval
    return render(ob, econtext.vars)
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/PageTemplates/Expressions.py", line 
89, in render
    ob = ob()
  File "/usr/lib/python2.2/site-
packages/roundup/cgi/templating.py", line 1499, in batch
    matches = self.client.db.indexer.search(
  File "/usr/lib/python2.2/site-
packages/roundup/indexer.py", line 145, in search
    hits = self.find(search_terms)
  File "/usr/lib/python2.2/site-
packages/roundup/indexer.py", line 224, in find
    hits[k] = self.fileids[k]
KeyError: 508

======8<=================================

This is quick'n'dirty fix:

Index: roundup/indexer.py
===================================================================
RCS file: /var/lib/cvs/nkm/roundup/roundup/indexer.py,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 indexer.py
224c224,225
<                     hits[k] = self.fileids[k]
---
>                     if self.fileids.has_key(k):
>                         hits[k] = self.fileids[k]
msg587 Author: [hidden] (richard) Date: 2003-01-16 05:56
Logged In: YES 
user_id=6405

This is caused by index corruption - delete your tracker's db/indexes 
directory and it'll be re-created the next time you add an issue. The 
corruption should be addressed in 0.5.4. 
 
 
History
Date User Action Args
2003-01-12 19:45:38anonymouscreate