---
url: https://milthm.cn/wiki/en/manual/technical-reference/searching.md
---
# Search Syntax

Milthm searches charts from the song-list search box and from the `q` query parameter of song-list deep links.

An empty or whitespace-only query returns all charts.

## Text Search

Text terms are searched against song and chart metadata. Milthm indexes:

* original and Latin song titles;
* composer / artist fields;
* artist lists;
* illustrator / illustration fields;
* charter lists;
* tags.

Search results are sorted by relevance.

### Tokens

Unquoted text is split by whitespace. The search syntax recognizes `<`, `<=`, `<>`, `=`, `==`, `>`, and `>=` as
operators.

Double-quoted text is kept as one query term, so it can contain spaces:

```text
"rain shower"
```

Quoted text is not an exact-match operator. It is searched like ordinary text.

Inside quoted text, Milthm supports these escapes:

| Escape | Meaning       |
|--------|---------------|
| `\"`   | double quote  |
| `\\`   | backslash     |
| `\n`   | newline       |
| `\r`   | carriage return |
| `\t`   | tab           |

## Filters

Filters use this shape:

```text
field operator value
```

You can combine text terms and filters in one query.

### Supported Fields

| Field aliases                         | Value type | Description                                  |
|---------------------------------------|------------|----------------------------------------------|
| `star`, `stars`, `difficulty`         | number     | Filter by normalized chart difficulty value. |
| `songid`, `song_id`, `song-id`        | string     | Filter by song ID.                           |
| `chartid`, `chart_id`, `chart-id`     | string     | Filter by chart ID.                          |

Field names are matched case-insensitively. Unsupported fields are ignored.

### Operators

For numeric difficulty filters:

| Operator | Meaning                  |
|----------|--------------------------|
| `<`      | less than                |
| `<=`     | less than or equal       |
| `=`      | equal                    |
| `==`     | equal                    |
| `<>`     | not equal                |
| `>=`     | greater than or equal    |
| `>`      | greater than             |

For `songid` and `chartid` string filters, use:

| Operator | Meaning   |
|----------|-----------|
| `=`      | equal     |
| `==`     | equal     |
| `<>`     | not equal |

Use `<>` for not-equal filters. `!=` is not supported.

## Examples

```text
difficulty >= 10
```

Find charts with normalized difficulty greater than or equal to `10`.

```text
songid = 3d466b94-8503-4b93-b39c-cd149c4fb760
```

Find charts belonging to the specified song ID.

```text
chartid <> 0896f11f-7a6d-4a99-8b47-b39388c35ee1
```

Exclude a chart ID.

```text
"rain shower" difficulty >= 10
```

Search for the phrase as one text term, then keep only charts with difficulty at least `10`.
