-
Notifications
You must be signed in to change notification settings - Fork 2
search api
-
Name:
dist
-
Returns:
application/json
-
URI Template Variables:
{in}
- Availability: API Server
Full text search API. Returns JSON describing the search results, as well as a
few metadata points. The index to be searched is determined by the {in}
URI
template variable, which may be any one of the following values:
-
docs
: Search the documentation. -
dists
: Search distribution metadata, includingREADME
s and tags. -
extensions
: Search extension metadata -
tags
: Search tags -
users
: Search users
The API supports the following parameters, which must be submitted via a URL encoded GET query string ("R" column indicates required parameters):
R | Param | Type | Default | Description |
---|---|---|---|---|
• | q |
String | The search query. |
| **`o`** | Number | 0 | Query results offset.
| **`l`** | Number | 50 | Query results limit.
The offset may be any positive integer and defaults to 0. The limit may be any positive integer between 1 and 1024. Defaults to 50 wen not specified, and reverts to 50 when any non-supported value is passed.
Search queries are free-form but support a few operators.
TBD.
The structure of the returned API is a single JSON object with the following keys:
Key | Type | Description |
---|---|---|
query |
String | The search query string |
offset |
Number | The the results offset. |
limit |
Number | The results limit. |
count |
Number | The total number of results. |
hits |
Array | The actual results in descending order by score. |
The contents of the hits
array is a list of objects, the structure of which
varies depending on the value of the {in}
URI template variable. A few
examples:
- Search for "test" in "docs"
- Search for "test" in "docs" with offset 1
- Search for "test" in "docs" with limit 1
- Search for "test" in "dists"
- Search for "integer" in "extensions"
- Search for "test" in "tags"
- Search for "david" in "users"
Each hit when when searching the docs
index reflects a single documentation
file that matched the search query. The hit objects contain the following
keys:
Key | Type | Description |
---|---|---|
title |
String | The title of the document |
excerpt |
String | An excerpt from the document highlight matched terms in <strong> elements. |
abstract |
String | A short description of the extension documented, if any. |
dist |
String | The name of the distribution in which the document is found. |
version |
SemVer | The version of the distribution release in which the document is found. |
docpath |
String | The path to the document within the distribution release, sans file name suffix. |
date |
Date | The date the release was uploaded to PGXN. |
user |
String | The nickname of the user who uploaded this release of the distribution. |
user_name |
String | The full name of the user who uploaded this release of the distribution. |
If you have any questions about the PGXN Mirror and API Server APIs, please post them to the PGXN Users list. If you find any bugs in the API, please report them. To follow news about PGXN, subscribe to the blog and the Mastodon stream.