# HG changeset patch # User FUJIWARA Katsunori # Date 2017-01-22 18:17:38 # Node ID 2ff913970025ef152b436cd791290eb078de5681 # Parent 73e3599971daf4e80e108f81228fd100c71ec518 journal: make "username:" filtering condition work as expected As described in previous revision, using TEXT in JOURNAL_SCHEMA causes unexpected results for "username:", too. - tokenization by non-alphanumeric characters - removing "stop words" To make "username:" filtering condition work as expected, this revision uses ID instead of TEST for "username" of JOURNAL_COLUMN. diff --git a/kallithea/lib/indexers/__init__.py b/kallithea/lib/indexers/__init__.py --- a/kallithea/lib/indexers/__init__.py +++ b/kallithea/lib/indexers/__init__.py @@ -79,7 +79,7 @@ CHGSET_IDX_NAME = 'CHGSET_INDEX' # used only to generate queries in journal JOURNAL_SCHEMA = Schema( - username=TEXT(), + username=ID(), date=DATETIME(), action=TEXT(), repository=ID(), diff --git a/kallithea/tests/functional/test_admin.py b/kallithea/tests/functional/test_admin.py --- a/kallithea/tests/functional/test_admin.py +++ b/kallithea/tests/functional/test_admin.py @@ -171,9 +171,9 @@ class TestAdminController(TestController #### "username:" filtering # "-" is valid character - ('username:peso-xxx', 0), + ('username:peso-xxx', 4), # using "stop words" - ('username:this-is-it', 2036), + ('username:this-is-it', 2), ## additional tests to quickly find out regression in the future ## (and check case-insensitive search, too)