# pub.chive.tag.search

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.tag.search)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.tag.search/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.tag.search/examples)

## Definitions

### `pub.chive.tag.search`

**Type**: `query`

Search for tags matching a query

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `q` | `string` | Yes | Search query |
| `limit` | `integer` | No | Maximum number of results to return |
| `cursor` | `string` | No | Pagination cursor for next page |
| `minQuality` | `integer` | No | Minimum quality score (0-100, scaled from 0-1) |
| `includeSpam` | `boolean` | No | Include tags flagged as potential spam |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `tags` | `array` | Yes | Search results |
| `total` | `integer` | No | Total count of matching tags |
| `cursor` | `string` | No | Cursor for next page |
| `hasMore` | `boolean` | Yes | Whether more results are available |

### `pub.chive.tag.search#tagSummary`

**Type**: `object`

Summary information for a tag

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `isPromoted` | `boolean` | Yes | Whether the tag has been promoted to a facet or authority |
| `promotedTo` | `ref` → `#promotionTarget` | No | Promotion target if promoted |
| `usageCount` | `integer` | Yes | Number of eprints tagged with this tag |
| `displayForms` | `array` | Yes | All display forms used for this tag |
| `qualityScore` | `integer` | Yes | Tag quality score (0-100, scaled from 0-1) |
| `normalizedForm` | `string` | Yes | Normalized tag form (lowercase, hyphenated) |

### `pub.chive.tag.search#promotionTarget`

**Type**: `object`

Target of tag promotion

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` | Yes | URI of the promotion target |
| `type` | `string` | Yes | Type of promotion target |

## Raw Schema

```json
{
  "id": "pub.chive.tag.search",
  "defs": {
    "main": {
      "type": "query",
      "errors": [],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "tags",
            "hasMore"
          ],
          "properties": {
            "tags": {
              "type": "array",
              "items": {
                "ref": "#tagSummary",
                "type": "ref"
              },
              "description": "Search results"
            },
            "total": {
              "type": "integer",
              "minimum": 0,
              "description": "Total count of matching tags"
            },
            "cursor": {
              "type": "string",
              "description": "Cursor for next page"
            },
            "hasMore": {
              "type": "boolean",
              "description": "Whether more results are available"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "q"
        ],
        "properties": {
          "q": {
            "type": "string",
            "maxLength": 100,
            "minLength": 2,
            "description": "Search query"
          },
          "limit": {
            "type": "integer",
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "description": "Maximum number of results to return"
          },
          "cursor": {
            "type": "string",
            "description": "Pagination cursor for next page"
          },
          "minQuality": {
            "type": "integer",
            "maximum": 100,
            "minimum": 0,
            "description": "Minimum quality score (0-100, scaled from 0-1)"
          },
          "includeSpam": {
            "type": "boolean",
            "default": false,
            "description": "Include tags flagged as potential spam"
          }
        }
      },
      "description": "Search for tags matching a query"
    },
    "tagSummary": {
      "type": "object",
      "required": [
        "normalizedForm",
        "displayForms",
        "usageCount",
        "qualityScore",
        "isPromoted"
      ],
      "properties": {
        "isPromoted": {
          "type": "boolean",
          "description": "Whether the tag has been promoted to a facet or authority"
        },
        "promotedTo": {
          "ref": "#promotionTarget",
          "type": "ref",
          "description": "Promotion target if promoted"
        },
        "usageCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of eprints tagged with this tag"
        },
        "displayForms": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "All display forms used for this tag"
        },
        "qualityScore": {
          "type": "integer",
          "maximum": 100,
          "minimum": 0,
          "description": "Tag quality score (0-100, scaled from 0-1)"
        },
        "normalizedForm": {
          "type": "string",
          "description": "Normalized tag form (lowercase, hyphenated)"
        }
      },
      "description": "Summary information for a tag"
    },
    "promotionTarget": {
      "type": "object",
      "required": [
        "type",
        "uri"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "description": "URI of the promotion target"
        },
        "type": {
          "type": "string",
          "description": "Type of promotion target",
          "knownValues": [
            "facet",
            "authority"
          ]
        }
      },
      "description": "Target of tag promotion"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
