> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slog.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

# Search

Slog provides a single, human-friendly text query that searches across tasks,
projects, and milestones at once. The same query syntax is used by the
[CLI](/cli) (`slog search`), the [SDK](/sdk) (`slog.search()`), and the
`GET /search` endpoint.

A query is a whitespace-separated list of **terms**. All terms are combined with
**AND**. Comma means **OR within a single field**, and a leading `-` **negates**
a term. There is no free-standing `OR` keyword and no parentheses.

```
login "auth flow" status:todo,blocked has:assignee priority:>=high due:<2026-06-30
```

reads as: text matches `login` AND the phrase `auth flow`, AND status is `todo`
or `blocked`, AND has an assignee, AND priority ≥ high, AND due before
2026-06-30.

***

## Term forms

| Term                   | Meaning                                            | Example                                   |
| ---------------------- | -------------------------------------------------- | ----------------------------------------- |
| bare word              | free-text keyword (substring match on text fields) | `login`                                   |
| `"quoted phrase"`      | exact-phrase free-text match                       | `"auth flow"`                             |
| `field:value`          | field filter (equality / membership)               | `status:blocked`                          |
| `field:OPvalue`        | comparison filter                                  | `due:>2026-06-30`                         |
| `field:a..b`           | range filter                                       | `due:2026-06-01..2026-06-30`              |
| `field:a,b,c`          | OR within one field                                | `status:todo,in_progress`                 |
| `-term`                | negation of any of the above                       | `-status:done`, `-label:wontfix`, `-spam` |
| `is:` / `has:` / `no:` | semantic aliases (see below)                       | `is:overdue`, `no:assignee`               |

A query with no `field:` terms is a pure keyword search; a query with no bare
words is a pure structured filter; the two mix freely.

***

## Operators and value modifiers

Modifiers are written as a prefix on the **value**, keeping `field:` clean.

| Written                                       | Meaning                          | Applies to                    |
| --------------------------------------------- | -------------------------------- | ----------------------------- |
| `field:v`                                     | equals                           | any (enum / text / id / date) |
| `field:>v` `field:>=v` `field:<v` `field:<=v` | greater / less than (or equal)   | dates, numbers, ordered enums |
| `field:a..b`                                  | range (≥ a and ≤ b)              | dates, numbers                |
| `field:a,b,c`                                 | matches any of                   | any                           |
| `-field:v`                                    | not equal (or not-in for a list) | any                           |
| `field:~text`                                 | contains (explicit substring)    | text fields                   |
| `field:^text`                                 | starts with                      | text fields                   |
| `field:*` / `has:field`                       | present (not null)               | nullable fields               |
| `field:none` / `no:field`                     | absent (null / empty)            | nullable fields & relations   |

* Enum and keyword matching is **case-insensitive** (`status:Blocked` =
  `status:blocked`). IDs and references are matched as given.
* `priority` is an **ordered** enum (`LOW < MEDIUM < HIGH < URGENT`), so
  `priority:>=high` is meaningful and expands to "high or urgent".

***

## Fields

### Universal fields (all resource types)

| Field (aliases)         | Value form                                                                                |
| ----------------------- | ----------------------------------------------------------------------------------------- |
| `status`                | enum value, resolved per type (see [Cross-resource semantics](#cross-resource-semantics)) |
| `team`                  | team prefix (`ENG`), name, or id                                                          |
| `label`                 | label name (quoted if it contains spaces)                                                 |
| `created` (`createdAt`) | date / range / relative                                                                   |
| `updated` (`updatedAt`) | date / range / relative                                                                   |
| `ref` (`reference`)     | text; supports `^` prefix match                                                           |
| `name` (`title`)        | text; `contains` by default                                                               |
| `id`                    | resource id                                                                               |
| `type` (`in`)           | `task`, `project`, `milestone` — narrows which kinds are searched                         |

### Type-specific fields

Using a type-specific field implicitly narrows results to the types that have it.
For example, `priority:high` returns only tasks; `due:overdue` returns tasks and
milestones (both have a due date) but never projects.

| Field (aliases)        | Available on      | Value form                                   |
| ---------------------- | ----------------- | -------------------------------------------- |
| `assignee`             | tasks             | person (see [People values](#people-values)) |
| `createdBy` (`author`) | tasks             | person                                       |
| `priority`             | tasks             | ordered enum                                 |
| `project`              | tasks             | project reference / name / id                |
| `parent`               | tasks             | task reference / id                          |
| `due` (`dueDate`)      | tasks, milestones | date / range / relative                      |
| `start` (`startDate`)  | milestones        | date / range / relative                      |

***

## Dates

Three interchangeable formats anywhere a date is expected:

* **Absolute:** `2026-06-02` (ISO `YYYY-MM-DD`). `YYYY-MM` and `YYYY` are
  allowed and expand to the natural range — `due:2026-06` ≡
  `due:2026-06-01..2026-06-30`.
* **Relative:** signed offset from today in `d` / `w` / `m` / `y` — `-7d`,
  `-2w`, `+1m`. Most useful with comparisons: `created:>-7d` (last week),
  `due:<+3d` (due within 3 days).
* **Named:** `today`, `yesterday`, `tomorrow`, `overdue` (= before today),
  `week` / `month` (the current calendar period as a range).

Examples: `due:today`, `due:overdue`, `created:>=-30d`,
`updated:2026-05-01..2026-05-31`.

***

## People values

Used by `assignee` and `createdBy` / `author`:

* `assignee:@me` (or `assignee:me`) — the current user
* `assignee:chris@aha.io` — resolved by email
* `assignee:"Chris W"` — resolved by name (quoted because it contains a space)
* `assignee:none` / `no:assignee` — unassigned
* `assignee:*` / `has:assignee` — assigned to anyone
* `assignee:@me,jordan@aha.io` — assigned to either

***

## Cross-resource semantics

A single query fans out to tasks, projects, and milestones and returns one mixed
result set.

* **The `type:` selector** narrows which kinds are searched: `type:task` (only
  tasks), `type:project,milestone` (both). Omitting `type:` searches all three.
* **Per-type value resolution.** The `status` enum differs by type. A `status:`
  value is matched against each type's own enum: `status:active` matches
  projects and milestones (`ACTIVE`); `status:blocked` matches only tasks
  (`BLOCKED`). A value that exists in no searched type's enum is a validation
  error with a "did you mean" hint.

***

## `is:` / `has:` / `no:` aliases

Friendly shortcuts that expand to the filters above. `has:` / `no:` are generic
presence / absence over any nullable field. `is:` is a curated set, including
cross-type states that paper over the per-type enum differences.

| Alias                          | Expands to                                                                                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `is:open`                      | not in a terminal state (task: not `DONE`/`CANCELLED`; project/milestone: not `COMPLETED`/`CANCELLED`) |
| `is:closed`                    | in a terminal state                                                                                    |
| `is:done`                      | task `DONE` / project·milestone `COMPLETED`                                                            |
| `is:active`                    | task `IN_PROGRESS` / project·milestone `ACTIVE`                                                        |
| `is:blocked`                   | task `BLOCKED` (tasks only)                                                                            |
| `is:overdue`                   | due date before today AND open (tasks, milestones)                                                     |
| `is:unassigned`                | unassigned (tasks only)                                                                                |
| `has:assignee` / `no:assignee` | assignee present / absent                                                                              |
| `has:label` / `no:label`       | has any label / none                                                                                   |
| `has:due` / `no:due`           | due date present / absent                                                                              |

Aliases compose with everything: `is:overdue is:blocked assignee:@me`.

***

## Free-text keywords

* A bare word matches a `contains` across a resource's primary text fields: task
  `title` + `description`, project / milestone `name` + `description`.
* A `"quoted phrase"` matches the whole phrase contiguously.
* Multiple keywords are ANDed (`login page` = contains "login" AND contains
  "page"). Use a quoted phrase to match `"login page"` as one unit.
* A negated keyword `-spam` excludes matches.

***

## Quoting and escaping

* Wrap any value containing spaces or `:` in double quotes: `label:"needs design"`,
  `name:"v2 launch"`.
* A literal quote inside a quoted value is `\"`; a literal backslash is `\\`.
* A leading `-` in a keyword is escaped as `\-` to avoid being read as negation.
* A bare word containing `:` that is not a known field (e.g. `http://x`) is
  treated as a keyword, not a filter — only registered field names trigger filter
  parsing.

***

## Examples

```
# Open, high-priority tasks assigned to me, due this week
is:open priority:>=high assignee:@me due:<=+7d

# Anything mentioning "billing" that's overdue
billing is:overdue

# Blocked tasks in the ENG team without an assignee
type:task is:blocked team:ENG no:assignee

# Projects or milestones that are active and created in the last month
type:project,milestone is:active created:>-1m

# Tasks labelled needs-design or needs-review, not done
label:"needs design","needs review" -is:done

# Phrase search scoped to one project
"payment retry" project:PROJ-014

# Reference prefix lookup across everything
ref:^ENG-
```
