# parts.page.mention.search

> Published by [page.parts](https://lexicon.garden/identity/did:plc:de2gzyliybvjo4bfvu4i54de)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search)
- [Documentation](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search/examples)

## Definitions

### `parts.page.mention.search`

**Type**: `query`

Search a mention service for matching results. A single XRPC host can serve multiple mention services, distinguished by the service AT URI.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of results to return |
| `scope` | `string` | No | Optional scope identifier to narrow results within a service, as returned by a previous result's subscope.scope field |
| `search` | `string` | Yes | Search query string |
| `service` | `string` (at-uri) | Yes | AT URI of the parts.page.mention.service record identifying which service to query |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `results` | `array` | Yes |  |

### `parts.page.mention.search#result`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` | Yes | Identifier for the mentioned entity |
| `href` | `string` (uri) | No | Optional web URL for the mentioned entity |
| `icon` | `string` (uri) | No | Optional icon URL for the mentioned entity, displayed next to the mention |
| `name` | `string` | Yes | Display name for the mentioned entity |
| `embed` | `ref` → `#embedInfo` | No | Optional embed info for creating an embed block instead of an inline mention |
| `labels` | `array` | No | A set of labels to be rendered with the mentionedEntity |
| `subscope` | `ref` → `#subscopeInfo` | No | Optional subscope info indicating this result can be scoped into for further searching |
| `description` | `string` | No | A description for the mentioned entity |

### `parts.page.mention.search#embedInfo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `src` | `string` (uri) | Yes | Source URL for the iframe embed |
| `width` | `integer` | No | Default width of the embed in pixels |
| `height` | `integer` | No | Default height of the embed in pixels |
| `aspectRatio` | `ref` → `#aspectRatio` | No | Aspect ratio of the embed. If provided, takes precedence over width/height for sizing. |

### `parts.page.mention.search#aspectRatio`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `width` | `integer` | Yes |  |
| `height` | `integer` | Yes |  |

### `parts.page.mention.search#mentionLabel`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `text` | `string` | No |  |

### `parts.page.mention.search#subscopeInfo`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `label` | `string` | Yes | Display label for the scope-down button (e.g. 'Posts', 'Tracks') |
| `scope` | `string` | Yes | Scope identifier passed back to the service in subsequent search queries |

## Raw Schema

```json
{
  "id": "parts.page.mention.search",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "results"
          ],
          "properties": {
            "results": {
              "type": "array",
              "items": {
                "ref": "#result",
                "type": "ref"
              },
              "maxLength": 50
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "service",
          "search"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "default": 20,
            "maximum": 50,
            "minimum": 1,
            "description": "Maximum number of results to return"
          },
          "scope": {
            "type": "string",
            "description": "Optional scope identifier to narrow results within a service, as returned by a previous result's subscope.scope field"
          },
          "search": {
            "type": "string",
            "description": "Search query string"
          },
          "service": {
            "type": "string",
            "format": "at-uri",
            "description": "AT URI of the parts.page.mention.service record identifying which service to query"
          }
        }
      },
      "description": "Search a mention service for matching results. A single XRPC host can serve multiple mention services, distinguished by the service AT URI."
    },
    "result": {
      "type": "object",
      "required": [
        "uri",
        "name"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "description": "Identifier for the mentioned entity"
        },
        "href": {
          "type": "string",
          "format": "uri",
          "description": "Optional web URL for the mentioned entity"
        },
        "icon": {
          "type": "string",
          "format": "uri",
          "description": "Optional icon URL for the mentioned entity, displayed next to the mention"
        },
        "name": {
          "type": "string",
          "description": "Display name for the mentioned entity"
        },
        "embed": {
          "ref": "#embedInfo",
          "type": "ref",
          "description": "Optional embed info for creating an embed block instead of an inline mention"
        },
        "labels": {
          "type": "array",
          "items": {
            "ref": "#mentionLabel",
            "type": "ref"
          },
          "description": "A set of labels to be rendered with the mentionedEntity"
        },
        "subscope": {
          "ref": "#subscopeInfo",
          "type": "ref",
          "description": "Optional subscope info indicating this result can be scoped into for further searching"
        },
        "description": {
          "type": "string",
          "description": "A description for the mentioned entity"
        }
      }
    },
    "embedInfo": {
      "type": "object",
      "required": [
        "src"
      ],
      "properties": {
        "src": {
          "type": "string",
          "format": "uri",
          "description": "Source URL for the iframe embed"
        },
        "width": {
          "type": "integer",
          "maximum": 3200,
          "minimum": 16,
          "description": "Default width of the embed in pixels"
        },
        "height": {
          "type": "integer",
          "maximum": 3200,
          "minimum": 16,
          "description": "Default height of the embed in pixels"
        },
        "aspectRatio": {
          "ref": "#aspectRatio",
          "type": "ref",
          "description": "Aspect ratio of the embed. If provided, takes precedence over width/height for sizing."
        }
      }
    },
    "aspectRatio": {
      "type": "object",
      "required": [
        "width",
        "height"
      ],
      "properties": {
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        }
      }
    },
    "mentionLabel": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "subscopeInfo": {
      "type": "object",
      "required": [
        "scope",
        "label"
      ],
      "properties": {
        "label": {
          "type": "string",
          "maxLength": 100,
          "description": "Display label for the scope-down button (e.g. 'Posts', 'Tracks')"
        },
        "scope": {
          "type": "string",
          "description": "Scope identifier passed back to the service in subsequent search queries"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
