Go to search

About the search

The search covers the Vespa documentation site, blog, PyVespa docs, and Vespa.ai. It offers autocomplete suggestions drawn from AI-generated example questions stored alongside each document.

The available pages are regularly updated by a web crawler. Each page is split into chunks and embedded. Chunk embeddings are stored in Vespa alongside the raw text, document title and source. The results link directly to the most relevant chunk for each page.

Embeddings, text and title are all used by Vespa for ranking the results. Each query uses hybrid scoring that combines exact word match (BM25) and semantic similarity.

Ranking

Candidates are retrieved by combining approximate nearest-neighbour search over chunk embeddings with traditional BM25 keyword matching. Every chunk then receives a hybrid score: 40% cosine similarity between the chunk and query embedding, and 60% lexical relevance. The lexical component is a BM25 blend over the document title (30%), body (60%) and URL (10%), plus a small completeness bonus when the query terms match headings. This means a chunk inherits part of its score from how relevant the document as a whole is to the query. BM25 values are arctan-scaled to keep scores in a stable range regardless of document length.

A document's final score is 70% best-chunk score and 30% average of its top-10 chunk scores. This rewards pages with at least one closely matching passage while giving a lift to documents that are broadly relevant across many chunks.

Indexing pipeline

Crawling

Pages are crawled from four sources: Vespa Docs, Blog, PyVespa and Vespa.ai. All pages are classified by their source type.

Chunking

Documents are split into chunks sized to fit within the 256-token limit of all-MiniLM-L6-v2. Each chunk has some overlap with neighbours.

Embedding

Each chunk is embedded using all-MiniLM-L6-v2, 384-dimensional float vectors stored as dense tensors with HNSW indexing for approximate nearest-neighbor search.

Suggestion generation

Example questions are generated for each page using Gemini Flash Lite and stored alongside the document to power search suggestions.

Final document

The pages are stored in Vespa with their origin,title, content and embedded chunks. Each chunk is tagged with a subtitle for navigating to relevant sections.

Incremental updates

A SHA-256 hash of each page's content is stored so that subsequent crawl runs only re-embed and re-feed pages whose content has changed.