Beispiel #1
0
def records_hep_cataloger(order=None):
    if order is None:
        order = count(start=1)
    records = records_hep(order=order)
    records["aggs"].update({
        **hep_collection_aggregation(order=next(order)),
        **hep_curation_collection_aggregation(order=next(order)),
    })
    return records
Beispiel #2
0
def test_records_hep_cataloger_facets(inspire_app):
    with current_app.test_request_context():
        expected_filters = {
            "author",
            "author_count",
            "doc_type",
            "earliest_date",
            "citation_count",
            "citation_count_without_self_citations",
            "collaboration",
            "refereed",
            "citeable",
            "collection",
            "curation_collection",
            "subject",
            "arxiv_categories",
            "self_affiliations",
            "affiliations",
            "self_author_names",
            "rpp",
            "self_curated_relation",
            "experiments",
        }
        expected_aggregations = {
            **hep_earliest_date_aggregation(order=1, title="Date of paper"),
            **hep_author_count_aggregation(order=2),
            **hep_rpp(order=3),
            **hep_doc_type_aggregation(order=4),
            **hep_author_aggregation(order=5),
            **hep_subject_aggregation(order=6),
            **hep_arxiv_categories_aggregation(order=7),
            **hep_collaboration_aggregation(order=8),
            **hep_collection_aggregation(order=9),
            **hep_curation_collection_aggregation(order=10),
        }
        filters = current_app.config["CATALOGER_RECORDS_REST_FACETS"][
            "records-hep"]()["filters"].keys()
        aggregations = current_app.config["CATALOGER_RECORDS_REST_FACETS"][
            "records-hep"]()["aggs"]
        assert filters == expected_filters
        assert aggregations == expected_aggregations
Beispiel #3
0
    range_filter("earliest_date", format="yyyy", end_date_math="/y"),
    "citation_count":
    range_filter("citation_count"),
    "citation_count_without_self_citations":
    range_filter("citation_count_without_self_citations"),
    "collaboration":
    must_match_all_filter("facet_collaborations"),
    "refereed":
    must_match_all_filter("refereed"),
    "citeable":
    must_match_all_filter("citeable"),
    "collection":
    must_match_all_filter("_collections"),
    "curation_collection":
    filter_from_filters_aggregation(
        hep_curation_collection_aggregation(order=1)),
    "subject":
    hep_subject_must_match_all_or_missing_filter("facet_inspire_categories"),
    "arxiv_categories":
    must_match_all_filter("facet_arxiv_categories"),
    "experiments":
    must_match_all_filter("facet_experiment"),
    "rpp":
    filter_from_filters_aggregation(hep_rpp(order=1)),
}

JOBS_FILTERS = {
    "field_of_interest": terms_filter("arxiv_categories"),
    "rank": terms_filter("ranks"),
    "region": terms_filter("regions"),
    "status": terms_filter("status"),