changeset 6474:2ff913970025

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 23 Jan 2017 02:17:38 +0900
parents 73e3599971da
children caef0be39948
files kallithea/lib/indexers/__init__.py kallithea/tests/functional/test_admin.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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(),
--- 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)