Mercurial > kallithea
comparison rhodecode/lib/indexers/__init__.py @ 3062:a08624dd675e beta
Implemented filtering of admin journal based on Whoosh Query language
ref #210
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 05 Dec 2012 21:14:31 +0100 |
parents | 82fb2a161ddf |
children | a5f0bc867edc b76a595b7a5e |
comparison
equal
deleted
inserted
replaced
3061:7727faad5baf | 3062:a08624dd675e |
---|---|
33 | 33 |
34 from string import strip | 34 from string import strip |
35 from shutil import rmtree | 35 from shutil import rmtree |
36 | 36 |
37 from whoosh.analysis import RegexTokenizer, LowercaseFilter, StopFilter | 37 from whoosh.analysis import RegexTokenizer, LowercaseFilter, StopFilter |
38 from whoosh.fields import TEXT, ID, STORED, NUMERIC, BOOLEAN, Schema, FieldType | 38 from whoosh.fields import TEXT, ID, STORED, NUMERIC, BOOLEAN, Schema, FieldType, DATETIME |
39 from whoosh.index import create_in, open_dir | 39 from whoosh.index import create_in, open_dir |
40 from whoosh.formats import Characters | 40 from whoosh.formats import Characters |
41 from whoosh.highlight import highlight, HtmlFormatter, ContextFragmenter | 41 from whoosh.highlight import highlight, HtmlFormatter, ContextFragmenter |
42 | 42 |
43 from webhelpers.html.builder import escape, literal | 43 from webhelpers.html.builder import escape, literal |
86 removed=TEXT(), | 86 removed=TEXT(), |
87 changed=TEXT(), | 87 changed=TEXT(), |
88 ) | 88 ) |
89 | 89 |
90 CHGSET_IDX_NAME = 'CHGSET_INDEX' | 90 CHGSET_IDX_NAME = 'CHGSET_INDEX' |
91 | |
92 # used only to generate queries in journal | |
93 JOURNAL_SCHEMA = Schema( | |
94 username=TEXT(), | |
95 date=DATETIME(), | |
96 action=TEXT(), | |
97 repository=TEXT(), | |
98 ip=TEXT(), | |
99 ) | |
91 | 100 |
92 | 101 |
93 class MakeIndex(BasePasterCommand): | 102 class MakeIndex(BasePasterCommand): |
94 | 103 |
95 max_args = 1 | 104 max_args = 1 |