Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Search API (v2)
Simpler search API than Search API (v1) which exposes the main search functionality available on the site.
Your POST should include the
Content-Type: application/json; charset=utf-8 header.
In the POST body, you can include the following keys:
str (required): Your search query
one_of('text', 'sheet', 'merged') (required): The index you want to query. See Search API (v2)#Index Types for an explanation of each index
exact): the field you want to query. Common fields to query are
naive_lemmatizer for the
merged indexes. For querying the sheets index, commonly you'll query the
bool, str or list(str) (default=
False) by default, the ElasticSearch document is not returned. Specifying
True will return the entire document. Specifying a
list(str) will perform a projection on the document for the specified fields
0) the maximum distance between each query word in the resulting document.
0 means an exact match must be found
0) for paginating results. The number document to start returning.
0 means start at the first result
100) for paginating results. The total number of results to return, starting from
) a list of filters to filter results. These filters can be RegEx if querying the
text index. For the
sheet type, the filters are applied literally. Each filter is applied to its corresponding entry in the
 required if
filters is specified): Must be the same length as
filters. Each entry specifies the field to apply the corresponding filter in
): list of field to aggregate on. Common fields are
path for the
text type and
tags for the
one_of('sort', 'score') (default=
sort) how to sort results. If
sort the values are sorted according to
score, the value in
sort_fields is multiplied with the default ElasticSearch score.
list(str): list of fields to sort on. If
sort_method = 'score' this list should have exactly one item. Common fields to sort on are
False): whether or not to reverse the sort applied on
0): the number used in case there is a value missing in your
The API returns results in the standard ElasticSearch format. See Search API (v1) for a brief explanation