search.routes.ui module

Provides the main search user interfaces.

The name of the cookie to use to persist search parameters.

search.routes.ui.PARAMS_TO_PERSIST = ['order', 'size', 'abstracts', 'date-date_type']

These parameters should be persisted in a cookie.

Advanced search interface.

Return type:Union[str, Response]
search.routes.ui.apply_response_headers(response)[source]

Hook for applying response headers to all responses.

Return type:Response
search.routes.ui.current_url_params_builder()[source]

Add a function that gets the GET params from the current URL.

Return type:Dict[str, Callable]
search.routes.ui.current_url_sans_parameters_builder()[source]

Add a function to strip GET parameters from the current URL.

Return type:Dict[str, Callable]
search.routes.ui.external_url_builder()[source]

Add an external URL builder function to the template context.

Return type:Dict[str, Callable]

Use parameter values in a cookie as defaults if not explicitly provided.

This will replace request.args with a MultiDict in order to achieve mutability.

Return type:None

Short-cut for advanced search with group or archive pre-selected.

Note that this only supports options supported in the advanced search interface. Anything else will result in a 404.

Return type:Union[str, Response]
search.routes.ui.is_current_builder()[source]

Inject a function to evaluate whether or not a result is current.

Return type:Dict[str, Callable]
search.routes.ui.search(archives=None)[source]

Simple search interface.

Return type:Union[str, Response]
search.routes.ui.service_status()[source]

Health check endpoint for search.

Exercises the search index connection with a real query.

Return type:Union[str, Response]

Set request parameters in the cookie, to use as future defaults.

Return type:Response
search.routes.ui.url_for_author_search_builder()[source]

Inject a function to build author name query URLs.

Return type:Dict[str, Callable]
search.routes.ui.url_for_page_builder()[source]

Add a page URL builder function to the template context.

Return type:Dict[str, Callable]
search.routes.ui.url_with_params_builder()[source]

Inject a URL builder that handles GET parameters.

Return type:Dict[str, Callable]