-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
search: implement whoosh search engine
* Updates README. * Also adds some cosmetic fixes. * Adds a CLI with commands to initialize the index and index all pages. Co-authored-by: Pascal Repond <[email protected]>
- Loading branch information
1 parent
89410af
commit a937b1f
Showing
10 changed files
with
212 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,7 @@ dmypy.json | |
*.mo | ||
|
||
# Macosx | ||
.DS_Store | ||
.DS_Store | ||
|
||
# Whoosh index | ||
/examples/index/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Flask-Wiki | ||
# Copyright (C) 2023 RERO | ||
# | ||
# Flask-Wiki is free software; you can redistribute it and/or modify | ||
# it under the terms of the Revised BSD License; see LICENSE file for | ||
# more details. | ||
|
||
"""Click command-line interface for flask-wiki.""" | ||
|
||
import click | ||
from flask.cli import with_appcontext | ||
|
||
from .api import get_wiki | ||
|
||
|
||
@click.group() | ||
def flask_wiki(): | ||
"""Command-line interface for flask-wiki.""" | ||
pass | ||
|
||
|
||
@flask_wiki.command() | ||
@with_appcontext | ||
def init_index(): | ||
"""Init whoosh search index.""" | ||
get_wiki().init_search_index() | ||
|
||
|
||
@flask_wiki.command() | ||
@with_appcontext | ||
def index(): | ||
"""Index all wiki pages for whoosh search.""" | ||
get_wiki().index_all_pages() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.