mozilla-services / crashstats-tools

Command line tools and library for interacting with Crash Stats (https://crash-stats.mozilla.org/)
Mozilla Public License 2.0
9 stars 0 forks source link

supersearch defaults to looking at data in the last week--should be documented #147

Closed willkg closed 1 week ago

willkg commented 1 month ago

supersearch defaults to looking at data in the last week. This is because if you pass no date params, the SuperSearch API code sets the start and end dates to cover the last week.

$ supersearch --verbose --_return_query=1
Params: {'_return_query': ['1'], '_facets_size': 0, '_columns': ['uuid'], '_sort': ['-date']}
Using API token: xxx
supersearch: url: https://crash-stats.mozilla.org/api/SuperSearch/, params: {'_return_query': 1, '_facets_size': 0, '_columns': ['uuid'], '_sort': ['-date'], '_results_offset': 0, '_results_number': 100}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): crash-stats.mozilla.org:443
DEBUG:urllib3.connectionpool:https://crash-stats.mozilla.org:443 "GET /api/SuperSearch/?_return_query=1&_facets_size=0&_columns=uuid&_sort=-date&_results_offset=0&_results_number=100 HTTP/11" 200 460
{
    'query': {
        'query': {
            'filtered': {
                'query': {'match_all': {}},
                'filter': {'bool': {'must': [{'bool': {'must': [{'range': {'processed_crash.date_processed': {'gte': '2024-09-10T14:11:37+00:00'}}}, {'range': {'processed_crash.date_processed': {'lte': '2024-09-17T14:11:37+00:00'}}}]}}]}}
            }
        },
        'sort': [{'processed_crash.date_processed': {'order': 'desc'}}],
        'from': 0,
        'size': 100,
        'fields': ['processed_crash.uuid']
    },
    'indices': ['socorro202437', 'socorro202438']
}

If you want to do a supersearch on a different period of time, you need to specify date params.

This should be covered in the supersearch command help text.