|
@ -9,6 +9,7 @@ import flask_apscheduler |
|
|
SCRIPT_DIR = os.path.dirname(__file__) |
|
|
SCRIPT_DIR = os.path.dirname(__file__) |
|
|
SEARCH_DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "searchdata")) |
|
|
SEARCH_DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "searchdata")) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def init_search_index(APP): |
|
|
def init_search_index(APP): |
|
|
scheduler = flask_apscheduler.APScheduler() |
|
|
scheduler = flask_apscheduler.APScheduler() |
|
|
scheduler.api_enabled = False |
|
|
scheduler.api_enabled = False |
|
@ -31,7 +32,11 @@ def index_distribusis(APP): |
|
|
writer = ix.writer() |
|
|
writer = ix.writer() |
|
|
distribusis = _visible_distribusis(APP) |
|
|
distribusis = _visible_distribusis(APP) |
|
|
for distribusi in distribusis: |
|
|
for distribusi in distribusis: |
|
|
writer.add_document(title=distribusi.distribusiname, path="/a", content=distribusi.description) |
|
|
writer.add_document( |
|
|
|
|
|
title=distribusi.distribusiname, |
|
|
|
|
|
path="/a", |
|
|
|
|
|
content=distribusi.description, |
|
|
|
|
|
) |
|
|
writer.commit() |
|
|
writer.commit() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|