Ejemplo n.º 1
0
class TableApiSearchRequest(ListingSchema):
    q = search_fields.QueryStringField(all_fields=True, required=False,
                                       doc_template='docs/tables/fields/query_string.html')

    class Meta:
        strict = True
        ordered = True
Ejemplo n.º 2
0
class StringMatchSchema(ExtSchema):
    prefix = fields.MatchPhrasePrefixField(example='lorem ipsum')
    phrase = fields.MatchPhraseField(example='lorem ips')
    match = fields.MatchField(example='orem ipsu')
    query = fields.QueryStringField(example='*re* AND ipsum')
    suggest = fields.SuggestField(example='lorem ips',
                                  suggester_type='term',
                                  suggester_name='dataset-title-suggest')

    class Meta:
        default_field = 'match'
class GeoApiSearchRequest(ListingSchema):
    bbox = search_fields.BBoxField(required=False)
    dist = search_fields.GeoDistanceField(required=False)
    q = search_fields.QueryStringField(
        all_fields=True,
        required=False,
        doc_template='docs/tables/fields/query_string.html')
    sort = search_fields.SortField(doc_base_url='/resources')

    no_data = search_fields.NoDataField()

    class Meta:
        strict = True
        ordered = True
class TableApiSearchRequest(ListingSchema):
    q = search_fields.QueryStringField(
        all_fields=True,
        required=False,
        doc_template='docs/tables/fields/query_string.html')
    p = search_fields.TableApiMultiMatchField(
        required=False,
        description='Search phrase',
        doc_template='docs/generic/fields/query_field.html')
    sort = search_fields.SortField(
        sort_fields={},
        doc_base_url='/resources',
    )
    sum = search_fields.ColumnMetricAggregationField(aggregation_type='sum')
    avg = search_fields.ColumnMetricAggregationField(aggregation_type='avg')

    class Meta:
        strict = True
        ordered = True