<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yuvraj Singh Jadon</title>
    <description>The latest articles on DEV Community by Yuvraj Singh Jadon (@yuvraj-ceisium).</description>
    <link>https://dev.to/yuvraj-ceisium</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4237275%2Fbf187440-c32a-4d43-a314-8ed1c878dbc9.png</url>
      <title>DEV Community: Yuvraj Singh Jadon</title>
      <link>https://dev.to/yuvraj-ceisium</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yuvraj-ceisium"/>
    <language>en</language>
    <item>
      <title>What Is Vector Search?</title>
      <dc:creator>Yuvraj Singh Jadon</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:48:34 +0000</pubDate>
      <link>https://dev.to/ceisium/what-is-vector-search-48l6</link>
      <guid>https://dev.to/ceisium/what-is-vector-search-48l6</guid>
      <description>&lt;p&gt;&lt;em&gt;By Yuvraj Singh Jadon. Originally published on &lt;a href="https://ceisium.com/blog/what-is-vector-search/" rel="noopener noreferrer"&gt;Ceisium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fccbne8ddkq180yj6nsjw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fccbne8ddkq180yj6nsjw.webp" alt="A query vector follows a highlighted path toward a nearby cluster of related content."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A user searches the docs for &lt;code&gt;keep users logged in&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The answer may live under a heading called “Configure session lifetime.” A keyword search can match &lt;code&gt;users&lt;/code&gt; or &lt;code&gt;session&lt;/code&gt;, but it may miss the answer when the writer talks about a timeout, an idle period, or a cookie that lasts for seven days. The reader and the docs are describing the same need with different words.&lt;/p&gt;

&lt;p&gt;Nearby does not mean correct.   A nearby passage is a candidate, not a verdict.    Vector search helps with that first gap: it turns the query and each searchable passage into lists of numbers, then compares the lists to find related ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is vector search?
&lt;/h2&gt;

&lt;p&gt;The word “vector” sounds mathematical, but the first idea is simple. A vector is a row of numbers that describes a position. On a map, a coordinate such as &lt;code&gt;(3, 5)&lt;/code&gt; tells you where a point sits compared with other points. The numbers do not mean much by themselves; the position they make together is what we use.&lt;/p&gt;

&lt;p&gt;Here is a tiny vector:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[0.12, -0.44, 0.81, 0.09, ...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same is true here. &lt;code&gt;0.12&lt;/code&gt; is not “the session number,” and &lt;code&gt;-0.44&lt;/code&gt; is not “the timeout number.” Meaning comes from the pattern across the whole list. A search system compares one complete vector with another, looking for vectors that land near one another under the chosen comparison method.&lt;/p&gt;

&lt;p&gt;For text, a model creates one vector for the query and one for each passage. The vector made for a piece of text is called an embedding. So the next question is not “what does each number mean?” It is “how did the model learn to place related uses near one another?”&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an embedding?
&lt;/h2&gt;

&lt;p&gt;An embedding is the fixed-size list of numbers a model returns for a piece of content. The model turns text into numbers so a computer can compare that text with other text.&lt;/p&gt;

&lt;p&gt;To make the list, the model first breaks the text into small pieces called tokens. A token may be a whole word, part of a word, or punctuation. The model processes those pieces together through a trained neural network and returns one list with the same length every time the same model and setup are used.&lt;/p&gt;

&lt;p&gt;Developers do not choose those numbers by hand. During training, the model sees examples of how text is used and adjusts its internal settings. When two pieces are used in related ways, training pushes their output lists closer together. When a piece is unrelated, it should stay farther away. That repeated adjustment shapes the map.   The model uses the same internal map for every passage.   Think of this as the model's internal map for comparing meaning.&lt;/p&gt;

&lt;p&gt;The map is useful even though it is not a literal picture. During training, related uses are encouraged to produce nearby vectors in that learned space, while unrelated uses stay farther apart. It is a useful mental model, not a literal picture with human-readable x/y meanings.&lt;/p&gt;

&lt;p&gt;That learned space gives us a bridge to stored search data. If an entire page covers many unrelated ideas, one vector has to blur them together. Search usually needs smaller pieces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqwni9q26shg6fsuj6o1j.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqwni9q26shg6fsuj6o1j.webp" alt="Black llama-head blob connects differently worded phrases as nearby points on an embedding map beside the official Ceisium lockup."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Embeddings can place related phrases near one another even when the words differ.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets embedded?
&lt;/h2&gt;

&lt;p&gt;A search system could make one embedding for a whole page. That is often too coarse. A session guide might explain cookie lifetime, idle timeout, logout behavior, and account security. One page-level vector has to represent all of those ideas at once.&lt;/p&gt;

&lt;p&gt;Many systems split a page into smaller passages called chunks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Set the session lifetime&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Explain the idle timeout&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep users signed in after a restart&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;End a session when the user logs out&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each chunk gets its own embedding. Search can now retrieve the passage about lifetime instead of returning a broad page and asking the reader to hunt through it.&lt;/p&gt;

&lt;p&gt;Smaller chunks are not automatically better. If a warning lands in the next chunk, the result may lose the context that makes the setting safe. Chunking is a balance: narrow enough to be specific, but wide enough to keep the idea complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  How vector search works
&lt;/h2&gt;

&lt;p&gt;The full search path has five jobs. The first two happen while content is indexed. The other three happen when a user searches. The illustration shows the whole route before we walk through each handoff.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft4d0w9cwy7cuy9iuaoky.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft4d0w9cwy7cuy9iuaoky.webp" alt="Black llama-head blob moves prepared content through an embedding press, nearby candidates, a filter and reranking gate, and one final result beside the official Ceisium lockup."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full path covers content preparation, embedding, nearby candidates, filtering and reranking, and the final result.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Prepare the searchable content
&lt;/h3&gt;

&lt;p&gt;The system reads the pages or records it wants to search. It may clean the text, split long pages into chunks, and attach details such as the URL, section heading, product version, language, or publication date.&lt;/p&gt;

&lt;p&gt;Those details are metadata. They let later stages remove an old version or prefer the right language. This work happens before a reader types a query, so the stored content is ready when the request arrives.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create content embeddings
&lt;/h3&gt;

&lt;p&gt;The embedding model turns each chunk into a vector. The system stores that vector beside the original text and its metadata. When a reader later searches, the query must be embedded in a compatible way.&lt;/p&gt;

&lt;p&gt;Common model families you may encounter include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Family&lt;/th&gt;
&lt;th&gt;Examples documented by the provider or model card&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://developers.openai.com/api/docs/guides/embeddings" rel="noopener noreferrer"&gt;text-embedding-3-small&lt;/a&gt;  and &lt;code&gt;text-embedding-3-large&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Dimensions, cost, latency, and whether the model fits your language and domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://ai.google.dev/gemini-api/docs/embeddings" rel="noopener noreferrer"&gt;gemini-embedding-2&lt;/a&gt;  and &lt;code&gt;gemini-embedding-001&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Query/document task instructions, modality, dimensions, and compatibility when upgrading&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cohere&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.cohere.com/docs/cohere-embed" rel="noopener noreferrer"&gt;embed-v4.0&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Text or image inputs, dimensions, metric, and context length&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Voyage&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://docs.voyageai.com/docs/embeddings" rel="noopener noreferrer"&gt;voyage-4-large&lt;/a&gt;  and the &lt;code&gt;voyage-4&lt;/code&gt; family&lt;/td&gt;
&lt;td&gt;Query/document input type, output dimensions, cost, and latency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open weights&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://huggingface.co/BAAI/bge-large-en-v1.5" rel="noopener noreferrer"&gt;BAAI/bge-large-en-v1.5&lt;/a&gt;  and &lt;a href="https://huggingface.co/intfloat/e5-large-v2" rel="noopener noreferrer"&gt;intfloat/e5-large-v2&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;Hardware, language coverage, prompt format, dimensions, and serving cost&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a list of examples, not a popularity ranking. Choose based on query/document support, language and domain fit, dimensions, cost, and latency. The same compatible model and setup must be used for the items you compare. Two vectors are not compatible just because their lists happen to have the same length.&lt;/p&gt;

&lt;p&gt;If you switch to an incompatible model or setup, the stored content must be embedded again. Otherwise the old content vectors and new query vectors come from different maps.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Embed the query
&lt;/h3&gt;

&lt;p&gt;When a user searches, the model turns the query into a vector using the matching query setup. For our example, &lt;code&gt;keep users logged in&lt;/code&gt; becomes one more point in the same comparison map as the stored session-lifetime passages.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Retrieve nearby candidates
&lt;/h3&gt;

&lt;p&gt;The system compares the query vector with stored vectors. It gives each comparison a similarity score or distance. Closer vectors become the first candidates.&lt;/p&gt;

&lt;p&gt;For the session-lifetime query, the candidate list might start like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configure session lifetime&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Explain idle timeout behavior&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep users signed in after a restart&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Account security and logout&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is candidate retrieval. It finds a small set worth examining more carefully. It does not settle the final order.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Filter and rerank
&lt;/h3&gt;

&lt;p&gt;The system can now use clues that vector distance missed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A version filter removes an old session guide.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A product filter keeps the result in the right application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A language signal chooses the reader’s preferred language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A reranker places the direct configuration steps above a general security overview.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A reranker is a later model or scoring step that reads the candidate set more carefully. It can change the order. It cannot recover a useful passage that the retrieval step never found.&lt;/p&gt;

&lt;p&gt;The interface can then return the full docs page and open it near the matching session section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vector search, semantic search, and vector databases
&lt;/h2&gt;

&lt;p&gt;These names overlap, and different products use them differently. A simple distinction is enough for this article.&lt;/p&gt;

&lt;p&gt;Vector search is the mechanism: turn items into vectors and find nearby vectors.&lt;/p&gt;

&lt;p&gt;Semantic search is the goal: match what the reader means, even when the words differ. Vector search is one way to do that. Synonyms, query rewriting, and reranking can also add semantic behavior.&lt;/p&gt;

&lt;p&gt;A vector database stores and searches vectors. It usually provides indexing and metadata filters too. But you do not need a product called a vector database to use vector search. General search engines and database extensions can also provide vector indexes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is vector search AI?
&lt;/h3&gt;

&lt;p&gt;The embeddings usually come from a machine-learning model. The search step then compares the resulting vectors. That is not the same as asking a large language model to write an answer, and it does not turn the search system into a chatbot.&lt;/p&gt;

&lt;h2&gt;
  
  
  How is similarity measured?
&lt;/h2&gt;

&lt;p&gt;The model documentation usually tells you which comparison method to use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cosine similarity compares vector direction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dot product compares alignment and may also reflect vector size, depending on the embeddings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Euclidean distance measures the straight-line distance between points.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cosine similarity and dot product usually give higher values to closer matches. A distance gives lower values to closer matches.&lt;/p&gt;

&lt;p&gt;The resulting similarity score or distance is a ranking clue,   not a probability. A score of 0.87 does not mean 87% relevant. Scores from different models, metrics, or index settings should not be treated as if they share one scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does vector search stay fast?
&lt;/h2&gt;

&lt;p&gt;With a small collection, search can compare the query with every stored vector. This is an exact, brute-force search.&lt;/p&gt;

&lt;p&gt;That gets expensive as the collection grows. Many systems use approximate nearest-neighbor search, shortened to ANN. Instead of checking every vector, an ANN index guides the search toward promising parts of the collection.&lt;/p&gt;

&lt;p&gt;Imagine looking for a cafe in a city. You would start in an area likely to have cafes, then inspect nearby streets. You would not inspect every building in the city. Many ANN indexes follow the same broad idea, though their actual data structures differ.&lt;/p&gt;

&lt;p&gt;The shortcut is faster, but it can miss neighbors that a complete scan would find. Retrieval recall measures how often the search finds the neighbors or relevant results it was supposed to find. ANN settings trade some of that recall for lower latency or lower resource use.&lt;/p&gt;

&lt;p&gt;Approximate does not mean random. It means finding very good candidates without proving that every stored vector was checked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vector search vs keyword search
&lt;/h2&gt;

&lt;p&gt;Keyword search and vector search notice different things.&lt;/p&gt;

&lt;p&gt;Keyword methods such as &lt;a href="https://ceisium.com/blog/what-is-tf-idf/" rel="noopener noreferrer"&gt;TF-IDF&lt;/a&gt;  and &lt;a href="https://ceisium.com/blog/what-is-bm25/" rel="noopener noreferrer"&gt;BM25&lt;/a&gt;  work with the words in the query and document. They are good at protecting exact strings and judging how distinctive those strings are.&lt;/p&gt;

&lt;p&gt;Vector search compares model-made representations. It is useful when two phrases express a related idea with different words.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Query&lt;/th&gt;
&lt;th&gt;Typical keyword strength&lt;/th&gt;
&lt;th&gt;Typical vector strength&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;keep users logged in&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Match shared words if present&lt;/td&gt;
&lt;td&gt;Connect the query with session-lifetime documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;session timeout expired&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Protect the exact setting name&lt;/td&gt;
&lt;td&gt;Find passages that explain idle or maximum lifetime&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;remember my sign-in&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Match words such as &lt;code&gt;sign-in&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Connect the request with persistent-session guidance&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Exact strings still matter for configuration keys, product names, versions, and identifiers. Vector search helps when the reader and author chose different vocabulary. Neither method wins every query.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why hybrid search is common
&lt;/h2&gt;

&lt;p&gt;Hybrid search uses keyword and vector evidence together.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;keep users logged in&lt;/code&gt;, keyword retrieval protects a setting name when it appears. Vector retrieval can add passages about session lifetime, idle timeout, and persistent sign-in when the wording differs. Filters and later ranking decide what reaches the top.&lt;/p&gt;

&lt;p&gt;The two systems’ raw scores are not naturally comparable. A hybrid system might normalize the scores, combine result ranks, or rerank one merged candidate set. The method varies. The reason stays simple: exact wording and related meaning answer different parts of the same search.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where vector search helps
&lt;/h2&gt;

&lt;p&gt;Documentation search is a natural fit because readers do not always know a product’s preferred terms. A reader who asks to &lt;code&gt;keep users logged in&lt;/code&gt; can find a section called “Configure session lifetime.”&lt;/p&gt;

&lt;p&gt;Product search has the same vocabulary gap, but the search system still needs product filters and exact attributes to avoid a plausible-looking wrong result.&lt;/p&gt;

&lt;p&gt;Technical search often mixes plain language with exact identifiers. A natural-language request can find the right concept, while keyword evidence protects the endpoint or configuration key once it appears.&lt;/p&gt;

&lt;p&gt;Text is only the easiest example to follow. With a suitable model and setup, a system can also turn images, products, audio, or other items into vectors and compare them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where vector search can fail
&lt;/h2&gt;

&lt;p&gt;Vector search can find a nearby result that is still wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Similar topic, opposite instruction
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;keep sessions alive&lt;/code&gt; and &lt;code&gt;end sessions quickly&lt;/code&gt; are about the same subject. Their vectors may be close even though the instructions point in opposite directions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrong version or language
&lt;/h3&gt;

&lt;p&gt;A passage may explain the right idea for an old release or a different language while the reader needs current instructions. Similarity does not enforce those constraints by itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exact identifiers
&lt;/h3&gt;

&lt;p&gt;A configuration key, product name, or version may matter more than the broad topic. Keyword search often protects those exact values better.&lt;/p&gt;

&lt;h3&gt;
  
  
  Weak chunking
&lt;/h3&gt;

&lt;p&gt;If an instruction and its warning are split apart, the result may lose the context that makes it safe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Domain vocabulary
&lt;/h3&gt;

&lt;p&gt;An embedding model may handle common language well but struggle with a new API, internal terminology, a niche field, or a language it saw less often during training.&lt;/p&gt;

&lt;h3&gt;
  
  
  The nearest available result is still weak
&lt;/h3&gt;

&lt;p&gt;A top-k vector search returns the nearest available items unless the system applies a threshold or a no-result rule. If the collection has no useful answer, its closest passage can still be irrelevant.&lt;/p&gt;

&lt;p&gt;Vector search is a comparison mechanism, not a truth engine.    &lt;/p&gt;

&lt;h2&gt;
  
  
  How should vector search be evaluated?
&lt;/h2&gt;

&lt;p&gt;Do not judge a search system from three impressive demos. Build a test set that looks like real use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Paraphrases that use different words&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exact configuration keys and versions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Queries that mix natural language and code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Version-sensitive questions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Answers buried inside long pages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Opposite instructions with similar vocabulary&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Questions that should return no useful result&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;People can label which results are useful. Then you can measure whether those results appear near the top. Calibrate thresholds and no-result rules for the actual model, metric, content collection, and any score changes made by the search system.&lt;/p&gt;

&lt;p&gt;Also measure latency, failed searches, harmful false matches, and what changes after an embedding model or index update.&lt;/p&gt;

&lt;p&gt;Search quality comes from the whole path: content preparation, chunking, embeddings, keyword matching, vector retrieval, filters, and ranking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Vector search turns a query and searchable content into vectors, then looks for nearby vectors.&lt;/p&gt;

&lt;p&gt;An embedding model creates the numbers. A similarity function compares them. An ANN index can avoid checking every stored vector. Filters and reranking narrow the candidate list into a useful answer.&lt;/p&gt;

&lt;p&gt;This works well when a reader and an author use different words for the same need. It does not remove the need for exact keyword matches, version filters, good chunks, or honest evaluation.&lt;/p&gt;

&lt;p&gt;Treat vector similarity as one useful clue inside the full search path.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>data</category>
      <category>machinelearning</category>
      <category>search</category>
    </item>
    <item>
      <title>What Is an Inverted Index?</title>
      <dc:creator>Yuvraj Singh Jadon</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:40:23 +0000</pubDate>
      <link>https://dev.to/ceisium/what-is-an-inverted-index-1hom</link>
      <guid>https://dev.to/ceisium/what-is-an-inverted-index-1hom</guid>
      <description>&lt;p&gt;&lt;em&gt;By Yuvraj Singh Jadon. Originally published on &lt;a href="https://ceisium.com/blog/what-is-an-inverted-index/" rel="noopener noreferrer"&gt;Ceisium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzcf7mwwgxwp4qif2lrnk.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzcf7mwwgxwp4qif2lrnk.webp" alt="A term dictionary sends one highlighted term through posting lists to matching document nodes."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A user searches a help site for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reset password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The site has four pages. In this example, the search system indexes both the page title and the text below it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Page title&lt;/th&gt;
&lt;th&gt;Text&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;P1&lt;/td&gt;
&lt;td&gt;Manage your account&lt;/td&gt;
&lt;td&gt;Manage your account and password.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P2&lt;/td&gt;
&lt;td&gt;Reset a forgotten password&lt;/td&gt;
&lt;td&gt;Reset a forgotten password.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P3&lt;/td&gt;
&lt;td&gt;Billing help&lt;/td&gt;
&lt;td&gt;Download invoices and update payment details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P4&lt;/td&gt;
&lt;td&gt;Protect your account&lt;/td&gt;
&lt;td&gt;Protect your account with two-factor authentication.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The system could open all four pages and check every word. That works here, but repeating the scan for every query becomes wasteful as the collection grows.&lt;/p&gt;

&lt;p&gt;Instead, it prepares a lookup before the user searches. That lookup is an inverted index.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an inverted index?
&lt;/h2&gt;

&lt;p&gt;An inverted index maps each searchable term to the documents that contain it.&lt;/p&gt;

&lt;p&gt;For our four pages, part of the index looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;account        -&amp;gt; P1, P4
password       -&amp;gt; P1, P2
reset          -&amp;gt; P2
payment        -&amp;gt; P3
authentication -&amp;gt; P4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is similar to the index at the back of a book. You start with a topic and get the pages where it appears.&lt;/p&gt;

&lt;p&gt;The mapping is called inverted because it reverses the direction we begin with. The original content starts as pages containing words. Search needs   words pointing to pages    .&lt;/p&gt;

&lt;p&gt;The set of searchable terms is often called the &lt;strong&gt;vocabulary&lt;/strong&gt; or &lt;strong&gt;lexicon&lt;/strong&gt;. A term dictionary organizes those terms and points to their postings lists.&lt;/p&gt;

&lt;p&gt;The list beside each term is a &lt;strong&gt;postings list&lt;/strong&gt;. The postings list for &lt;code&gt;password&lt;/code&gt; is &lt;code&gt;P1, P2&lt;/code&gt;. Each document entry inside that list is one &lt;strong&gt;posting&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv1p6eti6zexfynrlaat.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flv1p6eti6zexfynrlaat.webp" alt="Black llama-head blob turning four page cards into a vocabulary whose terms point to P1 and P2 postings."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The direction changes: pages contain terms, but the search lookup starts with a term and follows it to page IDs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How is an inverted index built?
&lt;/h2&gt;

&lt;p&gt;The system first extracts the text it wants to make searchable. It then breaks that text into smaller units called tokens.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Reset a Forgotten Password"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;may become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reset, a, forgotten, password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The system may also make text lowercase or handle punctuation. These choices make document terms and later query terms compatible. The exact processing varies by implementation.&lt;/p&gt;

&lt;p&gt;Each final term is added to the postings for the field being indexed. Some systems keep separate term dictionaries and postings for fields such as titles and bodies.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does search use the index?
&lt;/h2&gt;

&lt;p&gt;Now the user searches for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reset password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The search system analyzes the query into terms compatible with those stored in the index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[reset, password]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it reads the two postings lists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reset    -&amp;gt; P2
password -&amp;gt; P1, P2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;P2 appears in both lists, so it contains both query terms. P1 appears only in the &lt;code&gt;password&lt;/code&gt; list, so it is a partial match. Whether P1 is retained depends on whether the search requires every term or allows partial matches.&lt;/p&gt;

&lt;p&gt;The shared part of the lists is their &lt;strong&gt;intersection&lt;/strong&gt;. For this query, the intersection is just P2.&lt;/p&gt;

&lt;p&gt;The engine can start with these short term-led lists instead of reopening every page to discover possible matches. Those possible matches are the candidates that a ranking method can order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faymntjfqedk5obba37yv.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faymntjfqedk5obba37yv.webp" alt="Black llama-head blob pulling reset and password posting strips through a clamp that keeps shared page P2 and leaves P1 as a partial match."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;P2 appears in both postings lists. It survives the intersection, while P1 is only a partial match.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does an inverted index rank the results?
&lt;/h2&gt;

&lt;p&gt;The index retrieves candidates and can store clues about them. A posting may include how often the term appeared and where it appeared among the other tokens. The system may also keep separate postings for the title and body.&lt;/p&gt;

&lt;p&gt;In our example, P2 contains both query terms, and both appear in its title. P1 contains only &lt;code&gt;password&lt;/code&gt;. A ranking formula can use those differences to give P2 a stronger score.&lt;/p&gt;

&lt;p&gt;Ranking turns those clues into an order.   The index retrieves possible matches and stored clues. The ranker decides their order.   &lt;/p&gt;

&lt;p&gt;Methods such as &lt;a href="https://ceisium.com/blog/what-is-bm25/" rel="noopener noreferrer"&gt;BM25&lt;/a&gt;  rank word-based matches using term evidence. The inverted index makes that evidence available; the ranking method decides how much each clue matters.&lt;/p&gt;

&lt;p&gt;Stored token positions can also support phrase or nearby-word search. P2 is not an exact-phrase match for &lt;code&gt;reset password&lt;/code&gt; because another word sits between the two terms. A hypothetical page containing the exact phrase could be treated differently from one where the words appear paragraphs apart. Not every index stores positions, so this behavior depends on the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when a page changes?
&lt;/h2&gt;

&lt;p&gt;Suppose P1’s title and text both change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Title: Manage your account
Text:  Manage your account and password.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Title: Profile and login settings
Text:  Update your profile and login settings.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conceptually, selected affected postings change like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;account  -&amp;gt; remove P1
password -&amp;gt; remove P1
profile  -&amp;gt; add P1
login    -&amp;gt; add P1
settings -&amp;gt; add P1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does not mean every engine edits one list in place. An implementation may write new index segments, mark old entries as deleted, merge segments later, or rebuild on a schedule. The useful reader model is simpler: P1 must stop appearing under its old terms and start appearing under its new ones.&lt;/p&gt;

&lt;p&gt;A single edit does not always require rebuilding the complete index. Search can still lag behind the source content when updates are delayed or batched.&lt;/p&gt;

&lt;p&gt;The targeted lookup has a cost. The index takes storage and work to build and maintain, and new content must reach it before search can use it.&lt;/p&gt;

&lt;p&gt;The index is a maintained lookup over the source content, not the source content itself.   The source page can change before its searchable representation is refreshed.   &lt;/p&gt;

&lt;h2&gt;
  
  
  What does an inverted index not solve?
&lt;/h2&gt;

&lt;p&gt;A basic inverted index is strong at finding exact or normalized word-based terms. It does not automatically understand every way a person can describe the same need.&lt;/p&gt;

&lt;p&gt;A user may search for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;forgot my login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;while the useful page says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reset your password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those phrases share little vocabulary. Synonym handling, spelling correction, query expansion, or &lt;a href="https://ceisium.com/blog/what-is-vector-search/" rel="noopener noreferrer"&gt;vector search&lt;/a&gt;  can help with differently worded meaning. An inverted index does not add those choices automatically.&lt;/p&gt;

&lt;p&gt;Word-based matching still matters for product names, API routes, error codes, and exact technical terms. A search system can combine more than one retrieval method when its query mix needs both literal and semantic evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inverted index summary
&lt;/h2&gt;

&lt;p&gt;An inverted index keeps a postings list for each searchable term.&lt;/p&gt;

&lt;p&gt;The basic flow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;indexed fields -&amp;gt; searchable terms -&amp;gt; postings lists
query          -&amp;gt; compatible terms -&amp;gt; matching postings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It makes candidate lookup targeted. Optional stored clues can support ranking and phrase behavior, while update work keeps the lookup fresh.&lt;/p&gt;

&lt;p&gt;Start with the term, then follow it to the documents.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>database</category>
      <category>search</category>
    </item>
  </channel>
</rss>
