Skip to content

Indexing & Analyzers ​

Configure how PiramideDB tokenizes text, stores vectors, and computes relevance when you create an index.

sql
CREATE INDEX documents_search_idx ON documents
USING piramidedb (tenant, body)
WITH (
  format = 7,
  analyzer = 'en',
  scoring = 'visible'
);

Index options ​

OptionDefaultAllowed valuesWhen to use
format77Recommended for all new indexes. Enables hybrid vector search, point-in-time filtering, facets, and grant-scoped scoring.
analyzer'standard''standard', 'en', 'pt', 'es', 'fr', 'de', 'it', 'nl'Choose 'standard' for exact codes/identifiers or a language code for natural-language stemming.
scoring'corpus''visible', 'constant', 'corpus'Use 'visible' whenever rows have per-user or per-role permissions.
constant_avgdl50.0Any positive numberAverage document length used only when scoring = 'constant'.

Choosing an analyzer ​

  • standard folds case and accents without stemming. Use it for SKUs, ticket IDs, logs, or mixed-language technical records where exact tokens matter.
  • Language analyzers (en, pt, es, fr, de, it, nl) apply language-specific stemming so queries like rotating match rotated and rotation. Use them for articles, policies, support tickets, and knowledge bases.

Updating constant_avgdl online ​

If you use scoring = 'constant', you can tune constant_avgdl without rebuilding the index or blocking reads:

sql
ALTER INDEX documents_search_idx SET (constant_avgdl = 120.0);

PiramideDB is built by Nomad River.