Открыта бета 1С:ПредприятияОставить заявку
S

Search postgres

PostgreSQL search provider for Medusa, backed by tsvector and pg_trgm

Входит в @medusajs/medusa, ставить отдельно не нужно
Категория
Создано
Версия
2.22.4
Последнее обновление
7 часов назад
Ежемесячные загрузки
Загрузка данных

Medusa logo

@medusajs/search-postgres

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

PostgreSQL Search Module Provider for Medusa: full-text search, typo tolerance, filters, and facets over your search indexes, stored in the application's own PostgreSQL database. It's the default search provider, so search works without an external search engine. It ships with and is registered through the path.

At a glance

Package
TypeModule Provider (Search Module)
Provider ID
Registered by defaultYes, with ( when self-hosted, on Medusa Cloud)
Import from

Engines

EngineWhereKeyword searchVector search
(default)Any PostgreSQL databasePostgreSQL full-text search () with typo toleranceNot supported
Medusa Cloud onlyBM25 () with typo toleranceANN (), and hybrid keyword + vector search

Features

  • Free-text search with field weights and (default), , or (typeahead: the last term matches as a prefix).
  • Filters with , , , , range operators, and / / . On array fields, a bare value or means "contains".
  • Value, range, and stats facets scoped to the query's matches.
  • (one hit per value) and .
  • Vector and hybrid search on the engine. On , vector fields are dropped from the index with a warning, and vector queries are rejected.

Highlighting, geo fields, cursor pagination, and query-time locales aren't supported and are rejected.

Installation

No installation needed. The provider is a dependency of and is registered by default.

Usage

Register the provider yourself to pass options:

Then run the migrations, which enable the and extensions, create the text search configuration, and create your search indexes:

npx medusa db:migrate

To create or update only the search indexes, run .

If you set to anything other than , create a matching text search configuration yourself.

Configuration

OptionTypeDescriptionDefault
The search backend. works only on Medusa Cloud.
The PostgreSQL text search configuration language, such as or .
Turns text into an embedding. Required for vector fields that use and for .-
Distance metric for vector indexes.

Resources