{"id":17138,"date":"2025-05-22T09:54:28","date_gmt":"2025-05-22T16:54:28","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=17138"},"modified":"2025-06-13T22:45:04","modified_gmt":"2025-06-14T05:45:04","slug":"semantic-similarity-with-focused-selectivity","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/semantic-similarity-with-focused-selectivity\/","title":{"rendered":"Similaridade sem\u00e2ntica com seletividade focada"},"content":{"rendered":"<h2>Why does semantic search need selectivity?<\/h2>\n<p>Up until now, we\u2019ve viewed a vector embedding as a complete, stand-alone entity &#8211; focused entirely on the meaning it encodes. While this enables semantic search, often with a <a target=\"_blank\" href=\"https:\/\/www.couchbase.com\/blog\/vector-search-indexing-recall-faiss\/\" target=\"_blank\" rel=\"noopener\">high degree of similarity<\/a>, it remains limited to similarity among the query and dataset embeddings.<\/p>\n<p>The vector similarity search offering could not be relied upon to satisfy exact predicates. Pre-filtering aims to address exactly this gap &#8211; by searching for similar vectors only among those satisfying some filtering criteria.<\/p>\n<p>It\u2019s the embedding equivalent of limiting your search, whether for a job or a property, to a location. Say, you want a beachfront property in a specific state. You also want to limit your search to those with three bedrooms or more. Combing through listings without a method to filter for these criteria is almost unfeasible given a lot of listings.<\/p>\n<p>With pre-filtering, you can limit your search to a specific location by restricting the search space to eligible properties via geospatial and numeric queries. A vector similarity search for \u201cbeach-front\u201d, \u201cbeachside\u201d, \u201cwaterfront\u201d properties will be performed over this limited subset.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-17139\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-1024x289.png\" alt=\"\" width=\"900\" height=\"254\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-1024x289.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-300x85.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-768x217.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-1536x434.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1-1320x373.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image4-1.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Pre-filtering will allow users to specify filter queries as part of the kNN attribute in the query, only the results of which will be considered as eligible to be returned by the kNN query. Simply put, the user can now use the familiar FTS query syntax to <i>restrict the documents over which a kNN search will be performed<\/i>.<\/p>\n<h2>When to apply pre-filtering?<\/h2>\n<p>As the name suggests, the embeddings are metadata-filtered <i>before <\/i>the similarity search. This is different from post-filtering where a kNN search is followed by metadata-filtering. Pre-filtering offers a much higher chance of returning k hits, assuming there are at least those many documents which pass the filtering stage.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-17141\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-1024x291.png\" alt=\"\" width=\"900\" height=\"256\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-1024x291.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-300x85.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-768x219.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-1536x437.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1-1320x376.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image2-1.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-17140\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-1024x246.png\" alt=\"\" width=\"900\" height=\"216\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-1024x246.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-300x72.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-768x185.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-1536x370.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3-1320x318.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image1-3.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h2>How this works<\/h2>\n<p>Before we get into the guts of pre-filtering with kNN, let\u2019s understand how a vector and full-text index are co-located in the Search service index. Each Search index has one or more partitions, each of which has one or more segments. Each of these segments is a file, and the file is divided into separate sections, with one per type of index. Viewing a segment as a self-contained unit with both text and vector content of a <i>batch of documents<\/i> indexed will be useful for understanding how pre-filtering works at the segment level.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-17142 alignleft\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1-1024x658.png\" alt=\"Semantic Similarity with Focused Selectivity\" width=\"399\" height=\"257\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1-1024x658.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1-300x193.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1-768x494.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1-1320x848.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image6-1.png 1444w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/>A key consideration when building this was that it should be <i>predicate-agnostic<\/i> at search time. Essentially, this means that the filtering at the vector index should work the same way, irrespective of the full-text predicate. A text predicate over a text field should be no different from a numerical predicate over another.<\/p>\n<p>To this end, document numbers, identifiers unique to a document, are used to demarcate which documents are eligible for the kNN query. Every FTS query, whether text, numeric, or geospatial, boils down to identifying hits by their document number. Using document numbers means we do not have to change our indexing strategy for vectors, and limit it to a search time change.<\/p>\n<h3>Phase 1: Metadata filtering<\/h3>\n<p>Since a segment is essentially an immutable batch of documents, with their text and vector content indexed, the full-text metadata query returns all eligible documents <i>at the segment level<\/i>. Their document numbers are then passed to the vector index to retrieve the nearest eligible vectors.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-17143 size-large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-1024x500.png\" alt=\"Semantic Similarity with Focused Selectivity\" width=\"900\" height=\"439\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-1024x500.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-300x146.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-768x375.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-1536x750.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1-1320x644.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image3-1.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h3>Phase 2: kNN search<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-17144\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1-707x1024.png\" alt=\"Semantic Similarity with Focused Selectivity\" width=\"400\" height=\"579\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1-707x1024.png 707w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1-207x300.png 207w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1-768x1112.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1-300x434.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/image5-1.png 804w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/>The current algorithm which picks the <em>nprobe<\/em> clusters closest to the query vector in an IVF index is <i>essentially flying blind<\/i>\u00a0since it does not account for proximate clusters with few to no eligible documents. At search time, the selection of clusters to probe now has to <i>account for distribution of metadata-filtered hits<\/i> across the index.<\/p>\n<p>A cluster <em>closer<\/em>\u00a0to the query vector might have far fewer eligible hits than one much farther.<\/p>\n<p>Taking into account filter hit distribution while keeping recall high means that we cannot scan clusters solely on the basis of filter hit density. What it does mean is that we attempt to minimize distance computations for ineligible vectors, even as we scan as many clusters as needed to return the <em>k nearest neighbors<\/em>.<\/p>\n<p>Earlier, <em>nprobe<\/em> was defined as the <i>absolute limit<\/i> to the number of clusters scanned. Now, it\u2019s more of a minimum number of clusters to scan assuming fewer clusters have enough eligible vectors. In cases of sparse filter hit distribution, where each cluster has relatively few eligible vectors, our quest for k nearest neighbours can lead us to <i>scan far more than nprobe clusters<\/i>. Both filtered and unfiltered kNN scan clusters in increasing order of distance from the query vector, with the difference lying in scanning a subset of vectors across a potentially larger number of clusters.<\/p>\n<pre class=\"lang:c++ decode:true\">eligible_clusters: clusters with at least 1 filtered hit\r\nif eligible_clusters &lt; nprobe :\r\n    scan all clusters\r\nelse:\r\n    total_hits(1,n): Cumulative count of eligible hits in closest 'n' eligible clusters\r\n    if total_hits(1,nprobe) &gt;= k:\r\n        scan nprobe eligible clusters\r\n    else:\r\n        while total_hits(1,n) &lt; k:\r\n            n++\r\n        scan n eligible clusters<\/pre>\n<p>Once the vector index returns the most similar vectors at a segment level, these are aggregated at a global index level similar to how it\u2019s done for kNN without filtering.<\/p>\n<h3>How to use this<\/h3>\n<p>Let\u2019s take a bucket, <em>landmarks<\/em>. This is a sample document:<\/p>\n<pre class=\"lang:js decode:true\">{\r\n\u00a0\u00a0\"title\": \"Los Angeles\/Northwest\",\r\n\u00a0\u00a0\"name\": \"El Cid Theatre\",\r\n\u00a0\u00a0\"alt\": null,\r\n\u00a0\u00a0\"address\": \"4212 W Sunset Blvd\",\r\n\u00a0\u00a0\"directions\": null,\r\n\u00a0\u00a0\"phone\": null,\r\n\u00a0\u00a0\"tollfree\": null,\r\n\u00a0\u00a0\"email\": null,\r\n\u00a0\u00a0\"url\": null,\r\n\u00a0\u00a0\"hours\": null,\r\n\u00a0\u00a0\"image\": null,\r\n\u00a0\u00a0\"price\": null,\r\n\u00a0\u00a0\"content\": \"Built around turn of the century and, after several reincarnations, offers one of the only dinner theater options left in Los Angeles. The menu is heavily Spanish and the shows differ depending on the night and range from flamenco performances to tongue-in-cheek burlesque.\",\r\n\u00a0\u00a0\"geo\": {\r\n\u00a0\u00a0\u00a0\u00a0\"accuracy\": \"ROOFTOP\",\r\n\u00a0\u00a0\u00a0\u00a0\"lat\": 34.0939,\r\n\u00a0\u00a0\u00a0\u00a0\"lon\": -118.2822\r\n\u00a0\u00a0},\r\n\u00a0\u00a0\"activity\": \"do\",\r\n\u00a0\u00a0\"type\": \"landmark\",\r\n\u00a0\u00a0\"id\": 35034,\r\n\u00a0\u00a0\"country\": \"United States\",\r\n\u00a0\u00a0\"city\": \"Los Angeles\",\r\n\u00a0\u00a0\"state\": \"California\",\r\n\u00a0\u00a0\"embedding_crc\": \"fa6edfd97ffa665b\",\r\n\u00a0\u00a0\"embedding\": [-0.003134159604087472, -0.020280055701732635,.... \u00a0 -0.014541691169142723]\r\n}<\/pre>\n<p>Create an index, <em>test,<\/em> which indexes the <em>embedding<\/em>, <em>id<\/em> and <em>city<\/em> fields.<\/p>\n<p>My first query is an embedding of the Royal Engineers Museum in Gillingham:<\/p>\n<pre class=\"lang:js decode:true\">{\r\n\u00a0\u00a0\"knn\": [\r\n\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"k\": 10,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"field\": \"embedding\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"vector\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.0022478399332612753,\r\n        ....\r\n      ]\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0],\r\n\u00a0\u00a0\"explain\": true,\r\n\u00a0\u00a0\"size\": 10,\r\n\u00a0\u00a0\"from\": 0\r\n}<\/pre>\n<p>The closest hits I get are the London Fire Brigade Museum, the Verulamium Museum in St Albans and the RAF Museum in London.<\/p>\n<p>We now want to search for similar museums in Glasgow, that is, the city field should have a value <em>Glasgow<\/em>.<\/p>\n<p>Here\u2019s how the filtered query looks, with the <strong>filter<\/strong> clause added:<\/p>\n<pre class=\"lang:js decode:true\">{\r\n\u00a0\u00a0\"knn\": [\r\n\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"k\": 10,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"field\": \"embedding\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"vector\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.0022478399332612753,\r\n        ....\r\n  ],\r\n  \"filter\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"match\": \"Glasgow\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"field\": \"city\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0],\r\n\u00a0\u00a0\"explain\": true,\r\n\u00a0\u00a0\"size\": 10,\r\n\u00a0\u00a0\"from\": 0\r\n}<\/pre>\n<p>As expected, the results are now limited to those in Glasgow &#8211; the closest being the Kelvingrove Art Gallery and Museum and the Riverside Museum.<\/p>\n<p>As seen in this example, a filtered kNN query offers the advantage of selecting the documents for a similarity search using good, ol\u2019 FTS queries.<\/p>\n<h2>Keep learning<\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Read blog to learn more about FAISS and vector indexing, <a target=\"_blank\" href=\"https:\/\/www.couchbase.com\/blog\/vector-search-indexing-recall-faiss\/\">Vector Search Performance: The Rise of Recall<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/www.couchbase.com\/blog\/faster-llm-apps-semantic-cache-langchain-couchbase\/\">Build LLM Apps That Are Faster and Cheaper With Couchbase<\/a><\/li>\n<li><a target=\"_blank\" href=\"https:\/\/www.couchbase.com\/blog\/what-is-semantic-search\/\">What is Semantic Search?<\/a><\/li>\n<li>Start using Couchbase Capella today, <a target=\"_blank\" href=\"https:\/\/cloud.couchbase.com\/sign-up?ref=blog\">for free<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<p><a target=\"_blank\" href=\"https:\/\/cloud.couchbase.com\/sign-up?ref=blog\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-16409 \" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-1024x835.png\" alt=\"Free Cloud NoSQL DBaaS\" width=\"613\" height=\"500\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-1024x835.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-300x245.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-768x626.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-1536x1252.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-2048x1670.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/10\/capella-cloud-dbaas-couchbase-signup-free-1320x1076.png 1320w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why does semantic search need selectivity? Up until now, we\u2019ve viewed a vector embedding as a complete, stand-alone entity &#8211; focused entirely on the meaning it encodes. While this enables semantic search, often with a high degree of similarity, it [&hellip;]<\/p>\n","protected":false},"author":85141,"featured_media":17148,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,2165,8683,9936,9937],"tags":[10117],"ppma_author":[9962],"class_list":["post-17138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-full-text-search","category-geospatial","category-search","category-vector-search","tag-knn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Semantic Similarity with Focused Selectivity - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Discover how selective pre-filtering enhances semantic similarity search in Couchbase by combining vector and metadata queries.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/semantic-similarity-with-focused-selectivity\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Semantic Similarity with Focused Selectivity\" \/>\n<meta property=\"og:description\" content=\"Discover how selective pre-filtering enhances semantic similarity search in Couchbase by combining vector and metadata queries.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/semantic-similarity-with-focused-selectivity\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-22T16:54:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T05:45:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search-1024x536.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"536\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aditi Ahuja, Software Engineer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aditi Ahuja, Software Engineer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/\"},\"author\":{\"name\":\"Aditi Ahuja, Software Engineer\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/efea1290226a380570a7a86c651090a0\"},\"headline\":\"Semantic Similarity with Focused Selectivity\",\"datePublished\":\"2025-05-22T16:54:28+00:00\",\"dateModified\":\"2025-06-14T05:45:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/\"},\"wordCount\":1005,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2025\\\/05\\\/blog-semantic-search.png\",\"keywords\":[\"knn\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Full-Text Search\",\"Geospatial\",\"Search\",\"Vector Search\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/\",\"name\":\"Semantic Similarity with Focused Selectivity - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2025\\\/05\\\/blog-semantic-search.png\",\"datePublished\":\"2025-05-22T16:54:28+00:00\",\"dateModified\":\"2025-06-14T05:45:04+00:00\",\"description\":\"Discover how selective pre-filtering enhances semantic similarity search in Couchbase by combining vector and metadata queries.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2025\\\/05\\\/blog-semantic-search.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2025\\\/05\\\/blog-semantic-search.png\",\"width\":2400,\"height\":1256,\"caption\":\"blog-semantic-search selectivity\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/semantic-similarity-with-focused-selectivity\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Semantic Similarity with Focused Selectivity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/efea1290226a380570a7a86c651090a0\",\"name\":\"Aditi Ahuja, Software Engineer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=ga3eb898818ce7bdfc1b89af35c10b1f5\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=g\",\"caption\":\"Aditi Ahuja, Software Engineer\"},\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/aditi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Semantic Similarity with Focused Selectivity - The Couchbase Blog","description":"Descubra como a pr\u00e9-filtragem seletiva aprimora a pesquisa de similaridade sem\u00e2ntica no Couchbase, combinando consultas de vetores e metadados.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/semantic-similarity-with-focused-selectivity\/","og_locale":"pt_BR","og_type":"article","og_title":"Semantic Similarity with Focused Selectivity","og_description":"Discover how selective pre-filtering enhances semantic similarity search in Couchbase by combining vector and metadata queries.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/semantic-similarity-with-focused-selectivity\/","og_site_name":"The Couchbase Blog","article_published_time":"2025-05-22T16:54:28+00:00","article_modified_time":"2025-06-14T05:45:04+00:00","og_image":[{"width":1024,"height":536,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search-1024x536.png","type":"image\/png"}],"author":"Aditi Ahuja, Software Engineer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Aditi Ahuja, Software Engineer","Est. reading time":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/"},"author":{"name":"Aditi Ahuja, Software Engineer","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/efea1290226a380570a7a86c651090a0"},"headline":"Semantic Similarity with Focused Selectivity","datePublished":"2025-05-22T16:54:28+00:00","dateModified":"2025-06-14T05:45:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/"},"wordCount":1005,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search.png","keywords":["knn"],"articleSection":["Best Practices and Tutorials","Full-Text Search","Geospatial","Search","Vector Search"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/","url":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/","name":"Semantic Similarity with Focused Selectivity - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search.png","datePublished":"2025-05-22T16:54:28+00:00","dateModified":"2025-06-14T05:45:04+00:00","description":"Descubra como a pr\u00e9-filtragem seletiva aprimora a pesquisa de similaridade sem\u00e2ntica no Couchbase, combinando consultas de vetores e metadados.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2025\/05\/blog-semantic-search.png","width":2400,"height":1256,"caption":"blog-semantic-search selectivity"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/semantic-similarity-with-focused-selectivity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Semantic Similarity with Focused Selectivity"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/efea1290226a380570a7a86c651090a0","name":"Aditi Ahuja, engenheira de software","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=ga3eb898818ce7bdfc1b89af35c10b1f5","url":"https:\/\/secure.gravatar.com\/avatar\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=g","caption":"Aditi Ahuja, Software Engineer"},"url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/aditi\/"}]}},"acf":[],"authors":[{"term_id":9962,"user_id":85141,"is_guest":0,"slug":"aditi","display_name":"Aditi Ahuja, Software Engineer","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/c7e80b3dd70704a52cc5d032f55449eb2bc253009a8495c7a53ea50a14a014a8?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/17138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/85141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=17138"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/17138\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/17148"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=17138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=17138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=17138"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=17138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}