You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Charles Reid
f7ee48357b
|
6 years ago | |
---|---|---|
img | 6 years ago | |
static | 6 years ago | |
templates | 6 years ago | |
.gitignore | 6 years ago | |
LICENSE | 6 years ago | |
Readme.md | 6 years ago | |
Todo.md | 6 years ago | |
config.py.sample | 6 years ago | |
issues_app.py | 6 years ago | |
issues_search.py | 6 years ago | |
make_markdown.py | 6 years ago | |
markdown_parser.py | 6 years ago | |
requirements.txt | 6 years ago |
Readme.md
issues-search
use whoosh to search github issues.
Implemented in Python using Flask, Whoosh and Mistune.
notes
had to update how the update process worked:
- seems inefficient, but re-adding every document every index update
- works fine if not updating all the time
- gonna need to grab the content every time anyway
- need to add a field that's the content's hash
- compare indexed content's hash with fetched content's hash
when changing the schema:
- the schema changes, so the document addition changes (args)
- but also,
- in
issues_app.py
we call thesearch()
method on ourSearch
object - in
issues_search.py
,search()
method callscreate_search_result()
create_search_result()
extracts particular fields and bundles them up- the search results are ultimately returned to the app's
/search
endpoint, which passes them to a template as-is:search.html
- keyword:
entries = result
- therefore,
search.html
andcreate_search_result()
must also change to reflect changes in field names
- in
summary of how to change the schema:
issues_app.py
:- just combines the schema with the template, nothing to update
issues_search.py
:- main place where schema is defined/used
- Search class defines Schema object, main definition
add_issue()
(equally important) which defines how to extract the fields defined in the schema from the documentcreate_search_result()
(also important) which packages up the search results for the template to deal with
search.html
: the search.html template uses a different variable namespace than the Python fileissues_search.py
or the flask app- The
create_search-result()
method ofissues_search.py
defines how search results are parsed and packaged for thesearch.html
template - Jinja variables used in
search.html
should be defined increate_search_result()
method ofissues_search.py
- The