mirror of
https://github.com/LukeHagar/discoursejs.git
synced 2025-12-06 20:37:49 +00:00
19 lines
25 KiB
Markdown
19 lines
25 KiB
Markdown
# SearchRequest
|
|
|
|
## Example Usage
|
|
|
|
```typescript
|
|
import { SearchRequest } from "@lukehagar/discoursejs/sdk/models/operations";
|
|
|
|
let value: SearchRequest = {
|
|
page: 1,
|
|
q: "api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic",
|
|
};
|
|
```
|
|
|
|
## Fields
|
|
|
|
| Field | Type | Required | Description | Example |
|
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `page` | *number* | :heavy_minus_sign: | N/A | 1 |
|
|
| `q` | *string* | :heavy_minus_sign: | The query string needs to be url encoded and is made up of the following options:<br/>- Search term. This is just a string. Usually it would be the first item in the query.<br/>- `@<username>`: Use the `@` followed by the username to specify posts by this user.<br/>- `#<category>`: Use the `#` followed by the category slug to search within this category.<br/>- `tags:`: `api,solved` or for posts that have all the specified tags `api+solved`.<br/>- `before:`: `yyyy-mm-dd`<br/>- `after:`: `yyyy-mm-dd`<br/>- `order:`: `latest`, `likes`, `views`, `latest_topic`<br/>- `assigned:`: username (without `@`)<br/>- `in:`: `title`, `likes`, `personal`, `messages`, `seen`, `unseen`, `posted`, `created`, `watching`, `tracking`, `bookmarks`, `assigned`, `unassigned`, `first`, `pinned`, `wiki`<br/>- `with:`: `images`<br/>- `status:`: `open`, `closed`, `public`, `archived`, `noreplies`, `single_user`, `solved`, `unsolved`<br/>- `group:`: group_name or group_id<br/>- `group_messages:`: group_name or group_id<br/>- `min_posts:`: 1<br/>- `max_posts:`: 10<br/>- `min_views:`: 1<br/>- `max_views:`: 10<br/><br/>If you are using cURL you can use the `-G` and the `--data-urlencode` flags to encode the query:<br/><br/>```<br/>curl -i -sS -X GET -G "http://localhost:4200/search.json" \<br/>--data-urlencode 'q=wordpress @scossar #fun after:2020-01-01'<br/>```<br/> | api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic | |