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
|
7 years ago | |
---|---|---|
img | 7 years ago | |
static | 7 years ago | |
templates | 7 years ago | |
.gitignore | 7 years ago | |
LICENSE | 7 years ago | |
Readme.md | 7 years ago | |
Todo.md | 7 years ago | |
config.py.sample | 7 years ago | |
issues_app.py | 7 years ago | |
issues_search.py | 7 years ago | |
make_markdown.py | 7 years ago | |
markdown_parser.py | 7 years ago | |
requirements.txt | 7 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