geotribu_cli.search.search_content module¶
- geotribu_cli.search.search_content.filter_content_listing(json_filepath)¶
Filtering out irrelevant docs from content listing to reduce number of documents to index.
- Paramètres:
json_filepath (Path) – path to the input JSON file
- Renvoie:
filtered object
- Type renvoyé:
filter
- geotribu_cli.search.search_content.generate_index_from_docs(input_documents_to_index, index_ref_id, index_configuration, index_fieds_definition)¶
Build search index from input documents.
- geotribu_cli.search.search_content.parser_search_content(subparser)¶
Set the argument parser for search-content subcommand.
- Paramètres:
subparser (argparse.ArgumentParser) – parser to set up
- Renvoie:
parser ready to use
- Type renvoyé:
- geotribu_cli.search.search_content.run(args)¶
Run the sub command logic.
There are 2 files involved (names can vary):
site_content_listing.json: the downloaded file from the website which is just a listing of contents
site_search_index.json (= args.local_index_file): the file with the indexed contents with lunr built locally from the listing file.
Process:
Check if the local index file exists and is up to date
- If not:
Download the website contents listing from remote
Generate a local index from the contents listing
Load the local index
Perform the search
- Paramètres:
args (argparse.Namespace) – arguments passed to the subcommand