diff --git a/src/collective/dms/thesaurus/browser/thesaurusview.py b/src/collective/dms/thesaurus/browser/thesaurusview.py index 1ddd386..2c30b9b 100644 --- a/src/collective/dms/thesaurus/browser/thesaurusview.py +++ b/src/collective/dms/thesaurus/browser/thesaurusview.py @@ -134,9 +134,7 @@ class ListKeywordsView(BrowserView): other = [] q = query_string.lower() regex = re.compile(r"[\s'()]") - q_words = regex.split(q) items = self.getItems(query_string) - done = {} for normalized, title, id in items: count_start = 0 count_in = 0 @@ -148,7 +146,9 @@ class ListKeywordsView(BrowserView): count_in += 1 item = '%s|%s' % (title, id) - if count_start == len(query_terms): + if len(query_terms) == 1 and normalized.startswith(query_terms[0]): + absolute_startswith.append((normalized, item)) + elif len(query_terms) > 1 and count_start == len(query_terms): absolute_startswith.append((normalized, item)) elif count_start >= 1: startswith.append((normalized, item))