---
title: "Pylon Search: BM25 full-text and facets in your database"
description: "Add search: to an entity for BM25 ranking, live facets, and sort across millions of rows. The index lives in your DB, maintained transactionally, always consistent with your data."
url: "https://www.pylonsync.com/product/search"
---

Full-text search

# Full-text search, in your database.

Add search: to an entity and get BM25 ranking, live facets, and sort across millions of rows. The index lives in the same database and is maintained in the same transaction as your writes, so results are always consistent with your data.

[Create your account →](https://cloud.stack0.dev/signup)[Read the docs](https://docs.pylonsync.com)

schema.ts — searchable entity

```


const Product = entity("Product", {

  name: field.string(),

  description: field.string(),

  category: field.string().index(),

  price: field.int(),

}).search({

  fields: ["name", "description"],

  facets: ["category"],

});

```

- Built-in BM25 relevance ranking
- Live facets and sort keep filter counts current as data changes
- Index maintained transactionally with your writes; never stale
- Search scales with your database, with no separate service to deploy or sync

## How it works.

01Relevance, in your database02Facets and sort, live03Search scales with your database

faceted search

linen shirt312 hits

Apparel184

In stock96

Sale32

indexed in the same transaction

Pylon keeps a BM25 index in the same database and updates it in the same transaction as every write. Search results stay consistent with your data, and you operate one system instead of two.

## What you’d otherwise wire up.

Each line is a piece teams normally assemble for this one capability. On Pylon it is part of the runtime.

- A search cluster to provision, monitor, and pay for
- An indexing pipeline, and the lag between write and searchable
- Reindex jobs to run after every schema change
- Facet counts recomputed in application code on every query

## Apps built with it.

Scaffold any of these with `npm create @pylonsync/pylon`.

[All examples →](/developers/examples)

liveMarketplace

A trading marketplace deployed from a monorepo, with listings, watchlists, an activity feed, faceted search, and per-user ownership.

Faceted searchfield.owner()Optimistic inserts

template: marketplace[Open](https://market.pyln.dev) 

Directory

A curated directory with live full-text search, facets, community upvotes, and a moderated submission flow.

Full-text searchFacetsModeration

template: directory

Keep exploring

[Database

Typed schema. Migrations on save.](/product/database)

[Sync engine

Live queries over WebSocket.](/product/sync)

[Server functions

Backend logic in TypeScript.](/product/functions)

## Build it on Pylon.

One framework for your schema, sync, auth, functions, realtime, and SSR. Free to start.

[Create your account →](https://cloud.stack0.dev/signup)[Read the docs](https://docs.pylonsync.com)
