|
@@ -18,7 +18,7 @@ SCHEMA = Schema(
|
18
|
18
|
# Page
|
19
|
19
|
title=TEXT,
|
20
|
20
|
page_src=TEXT,
|
21
|
|
- page_tags=TEXT,
|
|
21
|
+ tag=TEXT,
|
22
|
22
|
# metadata
|
23
|
23
|
creation_time=DATETIME,
|
24
|
24
|
modified_time=DATETIME,
|
|
@@ -64,7 +64,7 @@ def add_item(ix, bp: base_page):
|
64
|
64
|
#
|
65
|
65
|
title=bp.title,
|
66
|
66
|
page_src=bp.raw_page_src,
|
67
|
|
- page_tags=bp.page_tags,
|
|
67
|
+ tag=bp.page_tags,
|
68
|
68
|
#
|
69
|
69
|
creation_time=datetime.fromtimestamp(bp._meta_data.get(bp._meta_data.KEY_CREATION_TIME)),
|
70
|
70
|
modified_time=datetime.fromtimestamp(bp._meta_data.get(bp._meta_data.KEY_MODIFIED_TIME)),
|
|
@@ -79,7 +79,7 @@ def add_item(ix, bp: base_page):
|
79
|
79
|
|
80
|
80
|
def whoosh_search(search_txt):
|
81
|
81
|
ix = load_index()
|
82
|
|
- qp = qparser.MultifieldParser(['title', 'page_src', 'page_tags'], ix.schema)
|
|
82
|
+ qp = qparser.MultifieldParser(['title', 'page_src', 'tag'], ix.schema)
|
83
|
83
|
qp.add_plugin(DateParserPlugin(free=True))
|
84
|
84
|
try:
|
85
|
85
|
q = qp.parse(search_txt)
|