# HG changeset patch # User FUJIWARA Katsunori # Date 1485105458 -32400 # 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 -r 73e3599971da -r 2ff913970025 kallithea/lib/indexers/__init__.py --- a/kallithea/lib/indexers/__init__.py Mon Jan 23 02:17:38 2017 +0900 +++ b/kallithea/lib/indexers/__init__.py Mon Jan 23 02:17:38 2017 +0900 @@ -79,7 +79,7 @@ # used only to generate queries in journal JOURNAL_SCHEMA = Schema( - username=TEXT(), + username=ID(), date=DATETIME(), action=TEXT(), repository=ID(), diff -r 73e3599971da -r 2ff913970025 kallithea/tests/functional/test_admin.py --- a/kallithea/tests/functional/test_admin.py Mon Jan 23 02:17:38 2017 +0900 +++ b/kallithea/tests/functional/test_admin.py Mon Jan 23 02:17:38 2017 +0900 @@ -171,9 +171,9 @@ #### "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)