{% extends "docs/docs_base.html" %} {% block doc_title %}Super Search API Reference{% endblock %} {% macro table_content(fields, columns_number, prefix="") %} {% for row in fields | batch(columns_number, "") %} {% for item in row %} {% if item == "" %} {% else %} {% if item.is_exposed %} {{ prefix }}{{ item.name }} {% else %} {{ prefix }}{{ item.name }} {% endif %} {% endif %} {% endfor %} {% endfor %} {%- endmacro %} {% block doc_content %}

Controls

_columns

list of strings ['uuid', 'date', 'signature', 'product', 'version']

List of fields to return in each result under the hits key.

The values you can use here are described in the List of fields section below.

_results_number

integer 100

Number of results the query will return under the hits key.

To get a large number of results, it is recommended to use the _results_offset parameter and a loop of queries instead of setting a big number here. Notably, since the first query will set some caching in the back-end, the following queries will be faster. Note as well that you should not be running any aggregations while getting a large amount of results in a loop, since those aggregations will be recalculated in each query.

To optimize your queries, if you are not using the content of the hits key, it is recommended to set _results_number to 0. That will save processing time and bandwidth.

_results_offset

integer 0

Index of the first result to return under the hits key.

Use this parameter to get a large number of results instead of setting an arbitrary big _results_number value. Run queries in a loop, incrementing this by the value of _results_number, and concatenate the content of the hits key.

Note that aggregations are run on the entire dataset corresponding to your filters, and not just on the restricted results defined by _results_offset and _results_number.

_sort

list of strings

List of fields used to sort the results under the hits key.

By default, the sorting is done by ascending order. Add a minus sign (-) before a field to sort it in descending order.

Aggregations

_aggs.*

list of strings

A parameter to run nested aggregations.

The structure is as follows: _aggs.field_1[.field_2]=field_3. Super Search is going to run an aggregation on field_1, then for each bucket of that aggregation, it will aggregate on field_2, and then for each bucket of that sub-aggregation, it will aggregate on field_3. Theoretically, we could have any number of levels of aggregations, but in practice we only allow all "level 1" aggregations, and a few "level 2" and "level 3".

{{ table_content(aggs_fields, 3, '_aggs.') }}
All parameters

_cardinality.*

A way to count the number of distinct values of a field (as opposed to counting the number of occurrences of each value).

Note that this is not an actual parameter. It has to be used as the value of another aggregation parameter, such as _facets, _aggs.* or _histogram.*.

{{ table_content(all_fields, 3, '_cardinality.') }}
All parameters

_facets

list of strings ['signature']

The most basic aggregation parameter. Pass it a list of field names to count the different terms of those fields in the dataset. For each field, it will return a list of terms, sorted in descending order of count.

_facets_size

integer 50

Number of terms returned in aggregations.

This parameter controls the size of all aggregations. It is not possible to paginate over aggregations. Note that the bigger this number is, the slower your request will return.

_histogram.*

list of strings

Run aggregations by range (instead of by terms) for date, integer, and float fields.

Instead of aggregating over terms (which doesn't make much sense for a datetime for example), histograms allow to create buckets per ranges of a defined size. That size is controlled by the _histogram_interval.* parameter. Each bucket's term is the lower bound of the range. If a bucket contains zero results, it will not be returned in the results.

{{ table_content(date_number_fields, 3, '_histogram.') }}
All parameters

_histogram_interval.*

string '1d' for date fields, 1 for integer and float fields

Controls the size of the interval of the associated _histogram.* parameter.

For integer and float fields, the value has to be an integer or float. For dates and datetimes, it has to be a string composed of an integer followed by a unit. To see the list of all accepted units, please see the Elasticsearch documentation.

{{ table_content(date_number_fields, 3, '_histogram_interval.') }}
All parameters

Filters

{% for filter in all_fields %} {% if filter.is_exposed %}

{{ filter.name }}

{{ filter.query_type }} {% if filter.default %} {{ filter.default }} {% endif %}

{% for op in operators[filter.query_type] %} {{ op }} {% endfor %}

{# NOTE(willkg): we use permissions_needed so it matches the protected crash schema rather than the webapp permissions which users won't understand #} {% if filter.permissions_needed %}

{{ filter.permissions_needed | join(', ') }}

{% endif %}

{{ filter.description }}

{% endif %} {% endfor %}

List of fields

This is the list of field names you can use in all parameters that accept a list of fields, as well as in composed aggregation parameters.

{{ table_content(all_fields, 4) }}
All fields
{% endblock %}