Ejemplo n.º 1
0
class ApplicationAggs(ExtSchema):
    date_histogram = search_fields.DateHistogramAggregationField(
        aggs={
            'by_modified': {
                'field': 'modified',
                'size': 500
            },
            'by_created': {
                'field': 'created',
                'size': 500
            }
        })

    terms = search_fields.TermsAggregationField(
        aggs={
            'by_tag': {
                'field': 'tags',
                'nested_path': 'tags',
                'size': 500,
                'translated': True
            },
            'by_keyword': {
                'field': 'keywords.name',
                'filter': {
                    'keywords.language': get_language
                },
                'nested_path': 'keywords',
                'size': 500,
            },
        })
Ejemplo n.º 2
0
class InstitutionApiAggregations(ExtSchema):
    date_histogram = search_fields.DateHistogramAggregationField(
        aggs={
            'by_modified': {
                'field': 'modified',
                'size': 500
            },
            'by_created': {
                'field': 'created',
                'size': 500
            },
            'by_verified': {
                'field': 'verified',
                'size': 500
            }
        }
    )
    terms = search_fields.TermsAggregationField(
        aggs={
            'by_city': {
                'field': 'city',
                'size': 500,
            },
            'by_institution_type': {
                'field': 'institution_type',
                'size': 10
            }
        }
    )
class ResourceAggregations(ExtSchema):
    date_histogram = search_fields.DateHistogramAggregationField(
        aggs={
            'by_modified': {
                'field': 'modified',
                'size': 500
            },
            'by_created': {
                'field': 'created',
                'size': 500
            },
            'by_verified': {
                'field': 'verified',
                'size': 500
            }
        })
    terms = search_fields.TermsAggregationField(
        aggs={
            'by_format': {
                'size': 500,
                'field': 'format'
            },
            'by_type': {
                'size': 500,
                'field': 'type',
            },
            'by_openness_score': {
                'size': 500,
                'field': 'openness_score'
            },
            'by_visualization_type': {
                'size': 500,
                'field': 'visualization_types'
            },
        })
Ejemplo n.º 4
0
class DatasetAggregations(ExtSchema):
    term = search_fields.TermsAggregationField(
        aggs={
            'by_institution': {
                'field': 'institution.id',
                'size': 500,
                'nested_path': 'institution',
            },
            'by_tag': {
                'size': 500,
                'field': 'tags.pl',
                'nested_path': 'tags'
            },
            'by_format': {
                'size': 500,
                'field': 'formats'
            },
            'by_openness_score': {
                'size': 500,
                'field': 'openness_scores'
            },
            'by_category': {
                'field': 'category.id',
                'size': 500,
                'nested_path': 'category'
            }
        })
Ejemplo n.º 5
0
class InstitutionApiAggregations(ExtSchema):
    term = search_fields.TermsAggregationField(
        aggs={
            'by_city': {
                'field': 'city',
                'size': 500,
            },
            'by_instytution_type': {
                'field': 'institution_type',
                'size': 10
            }
        })
Ejemplo n.º 6
0
class ResourceAggregations(ExtSchema):
    term = search_fields.TermsAggregationField(
        aggs={
            'by_format': {
                'size': 500,
                'field': 'format'
            },
            'by_type': {
                'size': 500,
                'field': 'type',
            },
            'by_openness_score': {
                'size': 500,
                'field': 'openness_score'
            },
        }
    )
Ejemplo n.º 7
0
class DataAggregations(ExtSchema):
    terms = fields.TermsAggregationField(
        aggs={
            'by_institution': {
                'field': 'institution.id',
                'size': 500,
                'nested_path': 'institution',
            },
            'by_category': {
                'field': 'category.id',
                'nested_path': 'category',
                'size': 100
            },
            'by_categories': {
                'field': 'categories.id',
                'nested_path': 'categories',
                'size': 100
            },
            'by_format': {
                'size': 500,
                'field': 'formats'
            },
            'by_openness_score': {
                'size': 500,
                'field': 'openness_scores'
            },
            'by_types': {
                'field': 'types',
                'size': 100
            },
            'by_visualization_types': {
                'field': 'visualization_types',
                'size': 100
            },
            'by_institution_type': {
                'field': 'institution_type',
                'size': 10
            },
            'by_license_code': {
                'field': 'license_code',
                'size': 100
            },
            'by_update_frequency': {
                'field': 'update_frequency',
                'size': 100
            },
            'by_has_high_value_data': {
                'field': 'has_high_value_data',
                'size': 100
            },
            'by_showcase_category': {
                'field': 'showcase_category',
                'size': 10
            },
            'by_showcase_types': {
                'field': 'showcase_types',
                'size': 10
            },
            'by_showcase_platforms': {
                'field': 'showcase_platforms',
                'size': 10
            },
        })

    date_histogram = fields.DateHistogramAggregationField(
        aggs={
            'by_modified': {
                'field': 'modified',
                'size': 500
            },
            'by_created': {
                'field': 'created',
                'size': 500
            },
            'by_verified': {
                'field': 'verified',
                'size': 500
            }
        })

    date_range = fields.MetricRangeAggregationField(aggs={
        'max': {
            'field': 'search_date'
        },
        'min': {
            'field': 'search_date'
        }
    })
class DatasetAggregations(ExtSchema):
    date_histogram = search_fields.DateHistogramAggregationField(
        aggs={
            'by_modified': {
                'field': 'modified',
                'size': 500
            },
            'by_created': {
                'field': 'created',
                'size': 500
            },
            'by_verified': {
                'field': 'verified',
                'size': 500
            }
        })

    terms = search_fields.TermsAggregationField(
        aggs={
            'by_institution': {
                'field': 'institution.id',
                'size': 500,
                'nested_path': 'institution',
            },
            'by_tag': {
                'field': 'tags',
                'nested_path': 'tags',
                'size': 500,
                'translated': True
            },
            'by_keyword': {
                'field': 'keywords.name',
                'filter': {
                    'keywords.language': get_language
                },
                'nested_path': 'keywords',
                'size': 500,
            },
            'by_format': {
                'size': 500,
                'field': 'formats'
            },
            'by_openness_score': {
                'size': 500,
                'field': 'openness_scores'
            },
            'by_category': {
                'field': 'category.id',
                'nested_path': 'category',
                'size': 100
            },
            'by_categories': {
                'field': 'categories.id',
                'nested_path': 'categories',
                'size': 100
            },
            'by_types': {
                'field': 'types',
                'size': 100
            },
            'by_visualization_types': {
                'field': 'visualization_types',
                'size': 100
            }
        })