Prompt

I'm building semantic search over product docs and need advice on storage and indexing

Artificial Intelligence / AI Search2 observationsLast seen Nov 9, 2026

Latest observation

Nov 9, 2026OpenAI APIWeb search: off

A good semantic search setup for product docs usually works best as a hybrid system:

  • Vector index for semantic similarity
  • Keyword / inverted index for exact terms, SKUs, error codes, product names, etc.
  • Metadata filters for product, version, doc type, locale, permissions, date, and so on

Recommended storage model

Store each doc in chunks, not only whole documents.

1) Raw document store

Keep the original content in object storage or a relational DB:

  • doc_id
  • title
  • source URL
  • product
  • version
  • language
  • permissions / ACL
  • timestamps
  • full text

This is your source of truth.

2) Chunk table

Break docs into chunks of roughly 200–800 tokens, with overlap.

Each chunk record should contain:

  • chunk_id
  • doc_id
  • chunk_text
  • chunk_order
  • section heading / hierarchy
  • metadata copied from parent doc
  • embedding vector

This is what you actually index for semantic retrieval.

3) Search indexes

Maintain:

  • Vector index on chunk embeddings
  • Text index for BM25 / keyword search
  • Optional reranker stage after retrieval

Indexing strategy

Chunking

For product docs, chunk by structure when possible:

  • headings
  • paragraphs
  • tables
  • list items
  • code blocks

Avoid splitting:

  • API signatures
  • steps in procedures
  • table rows
  • code examples

Use overlap so references near boundaries are preserved.

Embeddings

Generate embeddings for:

  • each chunk
  • optionally title + heading + chunk text together

Example input: "Product: X | Version: 3.2 | Section: Authentication | Text: ..."

That often improves retrieval.

Hybrid retrieval

Best practice is:

  1. Run vector search for semantic matches
  2. Run keyword search for exact matches
  3. Merge results
  4. Apply metadata filters
  5. Rerank top candidates with a cross-encoder or LLM reranker

This matters a lot for product docs because users often search for:

  • error codes
  • endpoint names
  • configuration flags
  • version-specific behavior
  • exact UI labels

Storage options

Small to medium scale

If you want simplicity:

  • Postgres + pgvector
  • plus full-text search in Postgres
  • maybe Redis for caching

Good if:

  • tens to hundreds of thousands of chunks
  • moderate query volume
  • you want fewer moving parts

Larger scale / more search-heavy

Use a dedicated vector DB or search engine:

  • Elasticsearch / OpenSearch for hybrid keyword + vector
  • Pinecone, Weaviate, Milvus, Qdrant for vector search
  • store metadata in Postgres or within the search engine

Good if:

  • millions of chunks
  • high QPS
  • need fast filtering and scaling

Metadata design tips

Include these fields in the index:

  • product
  • doc_type
  • version
  • locale
  • audience
  • release date
  • availability / access scope
  • section path
  • source system

This enables queries like:

  • “search only v2 docs”
  • “exclude internal drafts”
  • “only English docs”
  • “only docs for Product A”

Practical retrieval pipeline

A strong baseline:

  1. User query
  2. Normalize query
  3. Retrieve top 50 via vector search
  4. Retrieve top 50 via keyword search
  5. Combine with weighted scoring
  6. Filter by metadata/permissions
  7. Rerank top 10–20
  8. Return chunks with citations

Important pitfalls

  • Indexing entire docs only: hurts recall and citation quality
  • Chunking too small: loses context
  • Chunking too large: reduces precision
  • No metadata filters: results become noisy
  • Embedding-only search: misses exact technical terms
  • No reranker: top results may be semantically close but not best answer

Suggested starting architecture

If you want a simple, robust first version:

  • Postgres for doc storage + metadata
  • pgvector for embeddings
  • Postgres full-text search for BM25-like keyword retrieval
  • background worker for chunking + embedding
  • reranker service if needed

Rule of thumb

If your docs are technical/product docs, hybrid search is almost always better than pure vector search.

If you want, I can also give you:

  1. a concrete schema,
  2. an indexing pipeline,
  3. or a stack recommendation for your scale and budget.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.