diff --git a/src/collective/dms/thesaurus/browser/thesaurusview.py b/src/collective/dms/thesaurus/browser/thesaurusview.py index ef53ac4..d54867f 100644 --- a/src/collective/dms/thesaurus/browser/thesaurusview.py +++ b/src/collective/dms/thesaurus/browser/thesaurusview.py @@ -127,16 +127,17 @@ class ListKeywordsView(BrowserView): other = [] q = query_string.lower() regex = re.compile(r"[\s'()]") - for normalized, title, id in self.getItems(): + items = self.getItems() + for normalized, title, id in items: for term in query_terms: - if not term in title.lower(): + if not term in normalized.lower(): break else: item = '%s|%s' % (title, id) - if title.lower().startswith(q): + if normalized.lower().startswith(q): startswith.append((normalized, item)) continue - for word in regex.split(title): + for word in regex.split(normalized): if word.lower().startswith(q): intermediate.append((normalized, item)) break