Exemple #1
0
class CommitSearch(FacetedSearch):
    doc_types = ['commits']
    fields = ('description', 'files', )

    facets = {
        'files': TermsFacet(field='files'),
        'frequency': DateHistogramFacet(field='authored_date', interval="day", min_doc_count=1),
        'deletions': RangeFacet(field='stats.deletions', ranges=[('ok', (None, 1)), ('good', (1, 5)), ('better', (5, None))])
    }
Exemple #2
0
class CommitSearch(FacetedSearch):
    index = "flat-git"
    fields = (
        "description",
        "files",
    )

    facets = {
        "files": TermsFacet(field="files"),
        "frequency": DateHistogramFacet(
            field="authored_date", interval="day", min_doc_count=1
        ),
        "deletions": RangeFacet(
            field="stats.deletions",
            ranges=[("ok", (None, 1)), ("good", (1, 5)), ("better", (5, None))],
        ),
    }