Skip to content
All products

Full-text search

Find the words
that matter.

Search document text with keyword and phrase matching, or rank relevant results with BM25.

Inside full-text search: index, match and rankIllustrative example
THE QUERYvector searchWords become a route into your content.
01Index the content
doc-12title + body
A guide to vector search

Use embeddings to find relevant content. Vector search compares meaning.

doc-27title + body
Choosing a search index
02Find candidate documents
vector
doc-12doc-41
search
doc-12doc-27doc-41
BM25 weighsTerm frequencyTerm rarityDocument length
03Rank useful matches
  1. 01
    A guide to vector searchdoc-12Both terms in the title and body
  2. 02
    Choosing a search indexdoc-27Related text in the body
  3. 03
    Working with embeddingsdoc-41A shorter mention of vector search
Example ordering, not measured relevance scores.

Index text. Retrieve its record.

Make descriptions, articles and application content searchable. A shared document ID connects each search hit to its original record.

  1. Make text searchable

    Write a search entry under a document ID that matches your record's primary key. Choose the table and field you will query later.

  2. Choose the query

    Match terms or phrases, use BM25 for ranked results and fetch the corresponding records by ID when you need their full context.

Update the search entry when its source text changes. Row edits do not automatically re-index text.

Index a document

Why search on OriginChainDB?

Relevance you can inspect

Use BM25 scoring and its explain output to understand why documents match and how their terms contribute to a result.

Explore BM25 ranking

More precise queries

Use the JSON query DSL for field weights, filters, negation and multi-field search when a simple keyword query is not enough.

Explore search queries

Connected application data

Keep searchable text alongside SQL, vector and graph data, with shared IDs linking search results to the rest of your application.

See the data models
QUERY DESIGN

Three questions.
Three ways to search.

Choose the simplest search mode that answers your application's question.

Boolean

Does this document match?

Include or exclude content by its terms when relevance ordering is not needed.

See an example

Phrase

Do these words appear together?

Match an exact sequence such as a product name, quoted passage or technical phrase.

See an example

BM25

Which matches are most relevant?

Rank candidates using term frequency, term rarity and document length.

See an example

BM25, phrase search and advanced query options require the corresponding full-text capability on your instance.

RELEVANCE THAT FITS YOUR CONTENT

Give your important
fields more say.

A match in a product title may matter more than a passing mention in its description. Use multi-field weights to express that choice, then inspect the results.

Try a weighted query
Refine the resultAfter indexing
Field weights
Choose the relative importance of each searchable field.
Highlights & facets
Help users see where a match appears and explore grouped results with supported BM25 options.
Explain
Review why a document scored within this query. Scores are not comparable across different queries.
Read the search reference

Put it to work.

Start with ranked search

Index text and return relevant matches using BM25. The guide covers required capabilities and response formats.

BM25 example

Check current Elasticsearch support

Review dedicated deployment availability, authentication options and supported operations before connecting a client.

Current Elasticsearch support

Connect an Elasticsearch client

Use supported Elasticsearch 7.x clients through the compatibility API, with documented search operations, aggregations and limits.

Elasticsearch connection guide

Build with OriginChainDB.