Search¶
HEPData Search Views. |
hepdata.modules.search.views¶
HEPData Search Views.
- hepdata.modules.search.views.calculate_total_pages(query_result, max_results)[source]¶
Calculate the overall number of pages of results given the number of hits and max number of records displayed per page.
- hepdata.modules.search.views.check_page(args)[source]¶
Get the page query parameter from the URL and if it doesn’t exist assign a default value.
- hepdata.modules.search.views.check_max_results(args)[source]¶
Get the size query parameter from the URL and if it doesn’t exist assign a default value.
- hepdata.modules.search.views.check_date(args)[source]¶
Get the date parameter from the URL and if it doesn’t exist assign a default value.
- hepdata.modules.search.views.check_cmenergies(args)[source]¶
Get the cmenergies query parameter from the URL and convert to floats
- hepdata.modules.search.views.sort_facets(facets)[source]¶
Sort the facets in an arbitrary way that we think is appropriate.
- hepdata.modules.search.views.filter_facets(facets, total_hits)[source]¶
For the data keywords, show only the ones with >10 count, if there is more than 100 hits altogether. Filter out the empty ones.
- hepdata.modules.search.views.parse_query_parameters(request_args)[source]¶
Get query parameters from the request and preprocess them.
- Parameters
request_args – [dict-like structure] Any structure supporting get calls
- Result
[dict] Parsed parameters
- hepdata.modules.search.views.search()[source]¶
Main search endpoint. Parse the request, perform search and show the results.
- hepdata.modules.search.views.all_ids()[source]¶
Get IDs for all records (since a given date) as a JSON list of integers.
Accepts query parameters:
inspire_ids
: if set to a truthy value, return inspire IDs rather than HEPData record IDslast_updated
: return IDs updated since given date (in format YYYY-mm-dd)sort_by
: if set tolatest
, sort the results latest firstuse_es
: if set to a truthy values, use ElasticSearch rather than the database to return the ids