> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/interfaces/searchable.md).

# Searchable

Interface for full-text searchable entities

Audience: Programmer

The `Searchable` interface is implemented by entities that support full-text search capabilities, enabling fast and flexible searching across multiple fields.

## Fields

| Field             | Type      | Description                       |
| ----------------- | --------- | --------------------------------- |
| `searchableText`  | `String!` | Concatenated searchable content   |
| `searchRank`      | `Float`   | Relevance score in search results |
| `searchHighlight` | `String`  | Highlighted search matches        |

## Search Capabilities

* Full-text search across multiple fields
* Fuzzy matching and typo tolerance
* Relevance ranking
* Faceted search
* Search suggestions
* Synonym support

## Implementing Types

* InventoryItem (SKU, name, description)
* Customer (name, code, contact info)
* Supplier (name, code, products)
* PickingOrder (order number, customer)
* Product (name, description, attributes)

## Usage

```graphql
query {
  search(
    query: "wireless headphones"
    types: [INVENTORY_ITEM, PRODUCT]
    first: 10
  ) {
    edges {
      node {
        ... on Searchable {
          searchRank
          searchHighlight
        }
        ... on InventoryItem {
          id
          sku
          data
        }
      }
    }
    facets {
      field
      values {
        value
        count
      }
    }
  }
}
```

## Advanced Search

```graphql
query {
  inventoryItems(
    where: {
      searchableText_CONTAINS: "blue shirt"
      AND: {
        dataTypeSlug: "apparel"
      }
    }
    orderBy: {
      field: SEARCH_RANK
      direction: DESC
    }
  ) {
    edges {
      node {
        id
        sku
        searchRank
      }
    }
  }
}
```

## Search Indexing

Searchable entities are indexed with:

* Automatic field extraction
* Custom weight configuration
* Language-specific analyzers
* Stop word filtering
* Stemming and lemmatization

## Performance

* Indexed asynchronously
* Cached search results
* Pagination support
* Query optimization
* Result highlighting

## Best Practices

1. Index only necessary fields
2. Configure field weights appropriately
3. Use search suggestions for UX
4. Implement search analytics
5. Monitor index size and performance
6. Consider search result caching

## See Also

* [InventoryItem Type](/graphql-api/types/inventoryitem.md) - Searchable inventory
* [Customer Type](/graphql-api/types/customer.md) - Searchable customers
* [Where Inputs](/graphql-api/inputs/where-inputs.md) - Search filters


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/interfaces/searchable.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
