Filter search results in LanceDB based on metadata fields.
LanceDB supports filtering features of query results based on metadata fields.
While joint vector and metadata search at scale presents a significant challenge,
LanceDB achieves sub-100ms latency at thousands of QPS, enabling efficient vector search
with filtering capabilities even on datasets containing billions of records.Pre-filtering means LanceDB applies the metadata where(...) condition before running vector search, so the search only considers rows that already match the filter. Post-filtering means LanceDB runs vector search first and only then filters the returned candidates. Pre-filtering is enabled by default. In practice, pre-filtering is better when the filter is part of the result contract; post-filtering can be lower-latency for expensive or non-indexable filters, but it can return fewer than limit rows, or even zero, if the nearest neighbors do not pass the filter.On hybrid queries, the same where(...) filter is applied to both the vector and full-text halves of the query. The prefilter or postfilter choice controls whether that happens before each subquery scores candidates or after the subquery top-k is produced.
In more recent LanceDB SDK versions (see the callout box below for the exact version numbers), you can call where(...) (Python and TypeScript) or only_if(...) (Rust) more than once on the same query builder. Each additional filter is combined with the previous one using logical AND, so where("a > 0").where("b < 10") is equivalent to where("(a > 0) AND (b < 10)").For a fixed predicate, writing one where(...) clause with AND is just as valid and often clearer. Chaining is mainly useful when code composes filters incrementally, such as applying a shared base predicate in a helper and then adding a per-call predicate at the query site.
# Both filters apply: item is in the list AND price is above 15.result = ( table.search([100, 102]) .where("item IN ('foo', 'bar', 'baz')") .where("price > 15.0") .limit(3) .to_arrow())
// Both filters apply: item is in the list AND price is above 15.const result = await table .search([100, 102]) .where("item IN ('foo', 'bar', 'baz')") .where("price > 15.0") .limit(3) .toArray();
In Python SDK versions before 0.34.0 and Rust/TypeScript SDK versions before 0.31.0, a second where(...) or only_if(...) call replaced the first filter, so only the last predicate was applied. If your code needs to run on those older versions, write a single predicate with AND instead of chaining calls. When upgrading to the latest SDKs, review any existing chained filters and drop earlier calls you no longer want to apply.
You can always filter your data without search. This is useful when you need to query based on metadata:
filtered_no_search_result = ( table.search() .where("(item IN ('foo', 'bar', 'baz')) AND (price > 15.0)") .limit(3) .to_arrow())
const filteredResult = await table .query() .where("(item IN ('foo', 'bar', 'baz')) AND (price > 15.0)") .limit(3) .toArray();
If your table is large, this could potentially return a very large amount of data. Please be sure to use a limit clause unless you’re sure you want to return the whole result set.
post_filtered_result = ( table.search([100, 102]) .where("(item IN ('foo', 'bar')) AND (price > 15.0)", prefilter=False) .limit(3) .to_arrow())
const postFilteredResult = await (table.search([100, 102]) as VectorQuery) .where("(item IN ('foo', 'bar')) AND (price > 15.0)") .postfilter() .limit(3) .toArray();
When querying large tables, omitting a limit clause may overwhelm resources and return excessive data. It’s always recommended
to be mindful of the potential impact on performance and costs when working with really large tables.
Because it’s built on top of DataFusion, LanceDB embraces the utilization of standard SQL expressions as predicates for filtering operations. SQL can be used during vector search, update, and deletion operations.LanceDB supports a growing list of SQL expressions:
If your column name contains special characters, upper-case characters, or is a SQL Keyword,
you can use backtick (`) to escape it. For nested fields, each segment of the
path must be wrapped in backticks.
`CUBE` = 10 AND `UpperCaseName` = '3' AND `column name with space` IS NOT NULLAND `nested with space`.`inner with space` < 2
Field names containing periods (.) are NOT supported.
Scalar Indexes: We strongly recommend creating scalar indices on columns used for filtering, whether combined with a search operation or applied independently (e.g., for updates or deletions).For best performance with large tables or high query volumes:
Build a scalar index on frequently filtered columns
Use exact column names in filters (e.g., user_id instead of USER_ID)
Avoid complex transformations in filter expressions (keep them simple)
When running concurrent queries, use connection pooling for better throughput
For a column of type LIST(T), you can use LABEL_LIST to create a scalar index. Then you should leverage DataFusion’s array functions like array_has_any or array_has_all for optimized filtering.
Both pre-filtering and post-filtering can yield false positives. For pre-filtering, if the filter is too selective, it might eliminate relevant items that the vector search would have otherwise identified as a good match. In this case, increasing nprobes parameter will help reduce such false positives. It is recommended to call bypass_vector_index() if you know that the filter is highly selective.Similarly, a highly selective post-filter can lead to false positives. Increasing both nprobes and refine_factor can mitigate this issue. When deciding between pre-filtering and post-filtering, pre-filtering is generally the safer choice if you’re uncertain.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LanceDB","colors":{"primary":"#FF6B35","light":"#FF8A5C","dark":"#E55A2B"},"logo":{"light":"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/dark-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=d0592e59a29df2477080a857e13e341f","dark":"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/light-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=519956514d5529517daa4cb1f3d35392","href":"https://lancedb.com"},"favicon":"https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/favicon.ico?fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=84b9ea3dfc312b7a4dfc99219e229b33","appearance":{"strict":false},"background":{"color":{"light":"#FAF5F0","dark":"#000000"}},"navbar":{"links":[{"href":"https://www.lancedb.com/contact","label":"Support"}]},"footer":{"socials":{"github":"https://github.com/lancedb","linkedin":"https://www.linkedin.com/company/lancedb","x":"https://x.com/lancedb","discord":"https://discord.gg/AUEWnJ7Txb"},"links":[{"items":[{"label":"Cookie settings","href":"#cookie-settings"}]}]},"fonts":{"family":"Inter"},"styling":{"codeblocks":{"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}},"latex":true},"integrations":{"ga4":{"measurementId":"G-1TMC2PR69E"}},"banner":{"content":"[Why Multimodal Data Needs a Better Lakehouse? — Download the Research Study](https://lancedb.com/download/)","dismissible":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lancedb-bcbb4faf","hasAudioNarration":false,"actualSubdomain":"lancedb-bcbb4faf","customDomains":["docs.lancedb.com"],"gitSource":{"type":"github","owner":"lancedb","repo":"docs","deployBranch":"deploy-freeze","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad1ba1060c5abd76761bca2","collectionId":"f5c9f0e7-4822-4807-b59f-14a5f6599ae7","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad1ba1060c5abd76761bca2"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad1ba1060c5abd76761bca2","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Reference","count":112},{"language":"default","tag":"Documentation","count":97},{"language":"default","tag":"Integrations","count":76},{"language":"default","tag":"REST API","count":55},{"language":"default","tag":"Table","count":44},{"language":"default","tag":"Guides","count":41},{"language":"default","tag":"Feature Engineering (Geneva)","count":34},{"language":"default","tag":"Datasets","count":32},{"language":"default","tag":"Tutorials","count":16},{"language":"default","tag":"Embedding Providers","count":15}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"static/styles/style.css","content":":root{--banner-left:#e4d8f8;--banner-right:#e55a2b}@font-face{font-family:\"LanceDB KaTeX AMS\";src:url(https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/fonts/KaTeX_AMS-Regular.woff2) format(\"woff2\");font-display:swap;font-style:normal;font-weight:400}.katex .mathbb,.katex .textbb{font-family:\"LanceDB KaTeX AMS\",\"KaTeX_AMS\",serif!important}#banner,:where(.banner, [data-banner], [class*=\"Banner_banner\"]){background:linear-gradient(90deg,var(--banner-left) 0%,var(--banner-right) 100%)!important;color:#1b0f09!important;border:0!important}#banner a,:where(.banner, [data-banner], [class*=\"Banner_banner\"]) a{color:#1b0f09!important;font-size:.9rem;font-weight:500;text-decoration-color:rgba(27,15,9,.35)}#banner button,:where(.banner, [data-banner], [class*=\"Banner_banner\"]) button{color:#1b0f09!important}"}],"page":{"pagePath":"search/filtering","slug":"/search/filtering","pageMetadata":{"title":"Metadata Filtering in LanceDB","sidebarTitle":"Filtering","description":"Filter search results in LanceDB based on metadata fields.","icon":"filter","href":"/search/filtering"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Filter search results in LanceDB based on metadata fields.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`LanceDB supports filtering features of query results based on metadata fields.\nWhile joint vector and metadata search at scale presents a significant challenge,\nLanceDB achieves sub-100ms latency at thousands of QPS, enabling efficient vector search\nwith filtering capabilities even on datasets containing billions of records.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Pre-filtering`}),` means LanceDB applies the metadata `,_jsx(_components.code,{children:`where(...)`}),` condition before running vector search, so the search only considers rows that already match the filter. `,_jsx(_components.strong,{children:`Post-filtering`}),` means LanceDB runs vector search first and only then filters the returned candidates. Pre-filtering is enabled by default. In practice, pre-filtering is better when the filter is part of the result contract; post-filtering can be lower-latency for expensive or non-indexable filters, but it can return fewer than `,_jsx(_components.code,{children:`limit`}),` rows, or even zero, if the nearest neighbors do not pass the filter.`]}),`\n`,_jsxs(_components.p,{children:[`On hybrid queries, the same `,_jsx(_components.code,{children:`where(...)`}),` filter is applied to both the vector and full-text halves of the query. The prefilter or postfilter choice controls whether that happens before each subquery scores candidates or after the subquery top-k is produced.`]}),`\n`,_jsxs(Heading,{level:`2`,id:`chaining-where-clauses`,children:[`Chaining `,_jsx(_components.code,{children:`where`}),` clauses`]}),`\n`,_jsxs(_components.p,{children:[`In more recent LanceDB SDK versions (see the callout box below for the exact version numbers), you can call `,_jsx(_components.code,{children:`where(...)`}),` (Python and TypeScript) or `,_jsx(_components.code,{children:`only_if(...)`}),` (Rust) more than once on the same query builder. Each additional filter is combined with the previous one using logical `,_jsx(_components.code,{children:`AND`}),`, so `,_jsx(_components.code,{children:`where(\"a > 0\").where(\"b \u003c 10\")`}),` is equivalent to `,_jsx(_components.code,{children:`where(\"(a > 0) AND (b \u003c 10)\")`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For a fixed predicate, writing one `,_jsx(_components.code,{children:`where(...)`}),` clause with `,_jsx(_components.code,{children:`AND`}),` is just as valid and often clearer. Chaining is mainly useful when code composes filters incrementally, such as applying a shared base predicate in a helper and then adding a per-call predicate at the query site.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#A0ADA0`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#9399B2`,\"--shiki-dark-font-style\":`italic`},children:`# Both filters apply: item is in the list AND price is above 15.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`result `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item IN ('foo', 'bar', 'baz')`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price > 15.0`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`to_arrow`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#A0ADA0`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#9399B2`,\"--shiki-dark-font-style\":`italic`},children:`// Both filters apply: item is in the list AND price is above 15.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` result`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` table`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item IN ('foo', 'bar', 'baz')`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price > 15.0`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toArray`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`In Python SDK versions before `,_jsx(_components.code,{children:`0.34.0`}),` and Rust/TypeScript SDK versions before `,_jsx(_components.code,{children:`0.31.0`}),`, a second `,_jsx(_components.code,{children:`where(...)`}),` or `,_jsx(_components.code,{children:`only_if(...)`}),` call replaced the first filter, so only the last predicate was applied. If your code needs to run on those older versions, write a single predicate with `,_jsx(_components.code,{children:`AND`}),` instead of chaining calls. When upgrading to the latest SDKs, review any existing chained filters and drop earlier calls you no longer want to apply.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`example-metadata-filtering`,children:`Example: Metadata Filtering`}),`\n`,_jsx(_components.p,{children:`To illustrate filtering capabilities, let’s try four data points with combinations of vectors and metadata:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`data `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`vector`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3.1`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 4.1`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`],`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`foo`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 10.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`vector`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`5.9`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 26.5`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`],`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`bar`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 20.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`vector`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`10.2`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 100.8`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`],`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`baz`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 30.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`vector`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`1.4`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 9.5`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`],`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`item`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`fred`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`price`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 40.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`table `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` db`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`create_table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`metadata_filter_example`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` data`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`data`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` mode`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`overwrite`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`11`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` data`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` vector`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3.1`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 4.1`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` item`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`foo`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` price`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 10.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` vector`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`5.9`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 26.5`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` item`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`bar`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` price`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 20.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` vector`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`10.2`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 100.8`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` item`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`baz`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` price`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 30.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` vector`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`1.4`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 9.5`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` item`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`fred`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` price`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 40.0`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` tableName`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`metadata_filter_example`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` db`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`createTable`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:`tableName`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` data`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#998418`,\"--shiki-dark\":`#CDD6F4`},children:` mode`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`overwrite`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`filtering-without-vector-search`,children:`Filtering Without Vector Search`}),`\n`,_jsx(_components.p,{children:`You can always filter your data without search. This is useful when you need to query based on metadata:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`filtered_no_search_result `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar', 'baz')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`to_arrow`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`5`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` filteredResult`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` table`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`query`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar', 'baz')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toArray`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If your table is large, this could potentially return a very large amount of data. Please be sure to use a `,_jsx(_components.code,{children:`limit`}),` clause unless you’re sure you want to return the whole result set.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`pre-filtering-with-vector-search`,children:`Pre-Filtering with Vector Search`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`filtered_result `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`to_arrow`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` results`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` table`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toArray`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`post-filtering-with-vector-search`,children:`Post-Filtering with Vector Search`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`post_filtered_result `}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` prefilter`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#FAB387`},children:`False`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:` .`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`to_arrow`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`5`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` postFilteredResult`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:`table`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`])`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` as`}),_jsx(_components.span,{style:{color:`#2E8F82`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:` VectorQuery`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'bar')) AND (price > 15.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`postfilter`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`limit`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toArray`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`When querying large tables, omitting a `,_jsx(_components.code,{children:`limit`}),` clause may overwhelm resources and return excessive data. It’s always recommended\nto be mindful of the potential impact on performance and costs when working with really large tables.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`filtering-with-sql`,children:`Filtering with SQL`}),`\n`,_jsx(_components.p,{children:`Because it’s built on top of DataFusion, LanceDB embraces the utilization of standard SQL expressions as predicates for filtering operations. SQL can be used during vector search, update, and deletion operations.`}),`\n`,_jsx(_components.p,{children:`LanceDB supports a growing list of SQL expressions:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`SQL Expression`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`>, >=, \u003c, \u003c=, =`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Comparison operators`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`AND`}),`, `,_jsx(_components.code,{children:`OR`}),`, `,_jsx(_components.code,{children:`NOT`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Logical operators`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`IS NULL`}),`, `,_jsx(_components.code,{children:`IS NOT NULL`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Null checks`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`IS TRUE`}),`, `,_jsx(_components.code,{children:`IS NOT TRUE`}),`, `,_jsx(_components.code,{children:`IS FALSE`}),`, `,_jsx(_components.code,{children:`IS NOT FALSE`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Boolean checks`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`IN`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Value matching from a set`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`LIKE`}),`, `,_jsx(_components.code,{children:`NOT LIKE`})]}),_jsx(_components.td,{style:{textAlign:`left`},children:`Pattern matching`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`CAST`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Type conversion`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`regexp_match(column, pattern)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Regular expression matching`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`https://datafusion.apache.org/user-guide/sql/scalar_functions.html`,children:`DataFusion Functions`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Additional SQL functions`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`simple-sql-filters`,children:`Simple SQL Filters`}),`\n`,_jsx(_components.p,{children:`For example, the following filter string is acceptable:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,icon:`python`,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`tbl`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`.`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`]).`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'baz')) AND (price > 20.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`).`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#89B4FA`},children:`to_arrow`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`()`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,icon:`square-js`,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:`await`}),_jsx(_components.span,{style:{color:`#B07D48`,\"--shiki-dark\":`#CDD6F4`},children:` table`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`search`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`100`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 102`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`where`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`(item IN ('foo', 'baz')) AND (price > 20.0)`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#59873A`,\"--shiki-light-font-style\":`inherit`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toArray`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#999999`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`advanced-sql-filters`,children:`Advanced SQL Filters`}),`\n`,_jsxs(_components.p,{children:[`If your column name contains special characters, upper-case characters, or is a `,_jsx(_components.a,{href:`https://docs.rs/sqlparser/latest/sqlparser/keywords/index.html`,children:`SQL Keyword`}),`,\nyou can use backtick (`,_jsx(_components.code,{children:\"`\"}),`) to escape it. For nested fields, each segment of the\npath must be wrapped in backticks.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`CUBE`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 10`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` AND`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\" `\"}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`UpperCaseName`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` '`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`3`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`'`}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` AND`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\" `\"}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`column name with space`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:` IS NOT NULL`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:`AND`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\" `\"}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`nested with space`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`.`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`inner with space`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:` 2`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Field names containing periods (.) are NOT supported.`})}),`\n`,_jsx(Heading,{level:`3`,id:`dates-timestamps-decimals`,children:`Dates, Timestamps, Decimals`}),`\n`,_jsx(_components.p,{children:`Literals for dates, timestamps, and decimals can be written by writing the string\nvalue after the type name. For example:`}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`SQL`,icon:`SQL`,numberOfLines:`3`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes vitesse-light catppuccin-mocha`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#393a34`,\"--shiki-dark\":`#cdd6f4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`date_col `}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:` date`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` '`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`2021-01-01`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:`and`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` timestamp_col `}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:` timestamp`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:` '`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`2021-01-01 00:00:00`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E754F`,\"--shiki-dark\":`#CBA6F7`},children:`and`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:` decimal_col `}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#AB5959`,\"--shiki-dark\":`#CBA6F7`},children:` decimal`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`8`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`,`}),_jsx(_components.span,{style:{color:`#2F798A`,\"--shiki-dark\":`#FAB387`},children:`3`}),_jsx(_components.span,{style:{color:`#393A34`,\"--shiki-dark\":`#CDD6F4`},children:`) `}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`'`}),_jsx(_components.span,{style:{color:`#B56959`,\"--shiki-dark\":`#A6E3A1`},children:`1.000`}),_jsx(_components.span,{style:{color:`#B5695977`,\"--shiki-dark\":`#A6E3A1`},children:`'`})]}),`\n`]})})})}),`\n`,_jsx(_components.p,{children:`For timestamp columns, the precision can be specified as a number in the type\nparameter. Microsecond precision (6) is the default.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`SQL`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Time unit`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`timestamp(0)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Seconds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`timestamp(3)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Milliseconds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`timestamp(6)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Microseconds`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`timestamp(9)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Nanoseconds`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`apache-arrow-mapping`,children:`Apache Arrow Mapping`}),`\n`,_jsxs(_components.p,{children:[`LanceDB internally stores data in `,_jsx(_components.a,{href:`https://arrow.apache.org/`,children:`Apache Arrow`}),` format.\nThe mapping from SQL types to Arrow types is:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`SQL type`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Arrow type`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`boolean`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Boolean`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`tinyint`}),` / `,_jsx(_components.code,{children:`tinyint unsigned`})]}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`Int8`}),` / `,_jsx(_components.code,{children:`UInt8`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`smallint`}),` / `,_jsx(_components.code,{children:`smallint unsigned`})]}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`Int16`}),` / `,_jsx(_components.code,{children:`UInt16`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`int`}),` or `,_jsx(_components.code,{children:`integer`}),` / `,_jsx(_components.code,{children:`int unsigned`}),` or `,_jsx(_components.code,{children:`integer unsigned`})]}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`Int32`}),` / `,_jsx(_components.code,{children:`UInt32`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`bigint`}),` / `,_jsx(_components.code,{children:`bigint unsigned`})]}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`Int64`}),` / `,_jsx(_components.code,{children:`UInt64`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`float`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Float32`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`double`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Float64`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`decimal(precision, scale)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Decimal128`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`date`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Date32`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`timestamp`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.code,{children:`Timestamp`}),` [^1]`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Utf8`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`binary`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`Binary`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Scalar Indexes`}),`: We strongly recommend creating scalar indices on columns used for filtering, whether combined with a search operation or applied independently (e.g., for updates or deletions).`]}),`\n`,_jsx(_components.p,{children:`For best performance with large tables or high query volumes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Build a scalar index on frequently filtered columns`}),`\n`,_jsxs(_components.li,{children:[`Use exact column names in filters (e.g., `,_jsx(_components.code,{children:`user_id`}),` instead of `,_jsx(_components.code,{children:`USER_ID`}),`)`]}),`\n`,_jsx(_components.li,{children:`Avoid complex transformations in filter expressions (keep them simple)`}),`\n`,_jsx(_components.li,{children:`When running concurrent queries, use connection pooling for better throughput`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For a column of type LIST(T), you can use `,_jsx(_components.code,{children:`LABEL_LIST`}),` to create a scalar index. Then you should leverage DataFusion’s `,_jsx(_components.a,{href:`https://datafusion.apache.org/user-guide/sql/scalar_functions.html#array-functions`,children:`array functions`}),` like `,_jsx(_components.code,{children:`array_has_any`}),` or `,_jsx(_components.code,{children:`array_has_all`}),` for optimized filtering.`]}),`\n`,_jsx(Heading,{level:`2`,id:`limitations`,children:`Limitations`}),`\n`,_jsxs(_components.p,{children:[`Both `,_jsx(_components.strong,{children:`pre-filtering`}),` and `,_jsx(_components.strong,{children:`post-filtering`}),` can yield false positives. For pre-filtering, if the filter is too selective, it might eliminate relevant items that the vector search would have otherwise identified as a good match. In this case, increasing `,_jsx(_components.code,{children:`nprobes`}),` parameter will help reduce such false positives. It is recommended to call `,_jsx(_components.code,{children:`bypass_vector_index()`}),` if you know that the filter is highly selective.`]}),`\n`,_jsxs(_components.p,{children:[`Similarly, a highly selective post-filter can lead to false positives. Increasing both `,_jsx(_components.code,{children:`nprobes`}),` and `,_jsx(_components.code,{children:`refine_factor`}),` can mitigate this issue. When deciding between pre-filtering and post-filtering, pre-filtering is generally the safer choice if you’re uncertain.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}},"config":{},"pageMetadata":{"title":"Metadata Filtering in LanceDB","sidebarTitle":"Filtering","description":"Filter search results in LanceDB based on metadata fields.","icon":"filter","href":"/search/filtering"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Chaining where clauses","slug":"chaining-where-clauses","depth":2,"children":[]},{"title":"Example: Metadata Filtering","slug":"example-metadata-filtering","depth":2,"children":[{"title":"Filtering Without Vector Search","slug":"filtering-without-vector-search","depth":3,"children":[]},{"title":"Pre-Filtering with Vector Search","slug":"pre-filtering-with-vector-search","depth":3,"children":[]},{"title":"Post-Filtering with Vector Search","slug":"post-filtering-with-vector-search","depth":3,"children":[]}]},{"title":"Filtering with SQL","slug":"filtering-with-sql","depth":2,"children":[{"title":"Simple SQL Filters","slug":"simple-sql-filters","depth":3,"children":[]},{"title":"Advanced SQL Filters","slug":"advanced-sql-filters","depth":3,"children":[]},{"title":"Dates, Timestamps, Decimals","slug":"dates-timestamps-decimals","depth":3,"children":[]}]},{"title":"Apache Arrow Mapping","slug":"apache-arrow-mapping","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[]},{"title":"Limitations","slug":"limitations","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/lancedb-bcbb4faf/71b64c20a8f631b3/static/scripts/cookie-consent.js"],"subdomain":"lancedb-bcbb4faf","siteName":"LanceDB","title":"Metadata Filtering in LanceDB - LanceDB","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-02T18:51:20.660Z","originalFileLocation":"search/filtering.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Filter search results in LanceDB based on metadata fields.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LanceDB\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Metadata Filtering in LanceDB - LanceDB\">\u003cmeta data-mint-head property=\"og:description\" content=\"Filter search results in LanceDB based on metadata fields.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LanceDB\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.lancedb.com/search/filtering\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lancedb-bcbb4faf.mintlify.app/_mintlify/api/og/v2?division=Search\u0026amp;title=Metadata+Filtering+in+LanceDB\u0026amp;description=Filter+search+results+in+LanceDB+based+on+metadata+fields.\u0026amp;theme=123a95b5dfac0c4bc2a3854c\u0026amp;signature=8e4071ba57543f77ce13bf021828c936b57b045b8049e09aca8b664bf410105e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Metadata Filtering in LanceDB - LanceDB\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Filter search results in LanceDB based on metadata fields.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lancedb-bcbb4faf.mintlify.app/_mintlify/api/og/v2?division=Search\u0026amp;title=Metadata+Filtering+in+LanceDB\u0026amp;description=Filter+search+results+in+LanceDB+based+on+metadata+fields.\u0026amp;theme=123a95b5dfac0c4bc2a3854c\u0026amp;signature=8e4071ba57543f77ce13bf021828c936b57b045b8049e09aca8b664bf410105e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LanceDB\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF6B35\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.lancedb.com/search/filtering\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/search/filtering.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.lancedb.com/#organization\",\"name\":\"LanceDB\",\"url\":\"https://docs.lancedb.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/dark-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=d0592e59a29df2477080a857e13e341f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.lancedb.com#website\",\"name\":\"LanceDB\",\"url\":\"https://docs.lancedb.com\",\"publisher\":{\"@id\":\"https://docs.lancedb.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.lancedb.com/search/filtering#webpage\",\"url\":\"https://docs.lancedb.com/search/filtering\",\"name\":\"Metadata Filtering in LanceDB\",\"description\":\"Filter search results in LanceDB based on metadata fields.\",\"dateModified\":\"2026-07-02T18:51:20.660Z\",\"isPartOf\":{\"@id\":\"https://docs.lancedb.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.lancedb.com/search/filtering#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.lancedb.com/search/filtering#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.lancedb.com/tables/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Search\",\"item\":\"https://docs.lancedb.com/search/index\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Metadata Filtering in LanceDB\",\"item\":\"https://docs.lancedb.com/search/filtering\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.lancedb.com/search/filtering#article\",\"headline\":\"Metadata Filtering in LanceDB\",\"name\":\"Metadata Filtering in LanceDB\",\"description\":\"Filter search results in LanceDB based on metadata fields.\",\"url\":\"https://docs.lancedb.com/search/filtering\",\"mainEntityOfPage\":{\"@id\":\"https://docs.lancedb.com/search/filtering#webpage\"},\"dateModified\":\"2026-07-02T18:51:20.660Z\",\"publisher\":{\"@id\":\"https://docs.lancedb.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.lancedb.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LanceDB\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"LanceDB","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Quickstart","sidebarTitle":"Quickstart","icon":"rocket","href":"/quickstart"},{"group":"What is LanceDB?","pages":[{"title":"LanceDB","sidebarTitle":"LanceDB","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lancedb-icon-gray.svg","href":"/index"},{"title":"Lance format","sidebarTitle":"Lance format","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lance-logo-gray.svg","href":"/lance"},{"title":"Tables and Namespaces","sidebarTitle":"Tables and Namespaces","icon":"table","href":"/tables-and-namespaces"}]},{"group":"LanceDB Enterprise","pages":[{"title":"LanceDB Enterprise","sidebarTitle":"Overview","icon":"server","href":"/enterprise/index"},{"title":"Architecture","sidebarTitle":"Architecture","icon":"cubes","href":"/enterprise/architecture"},{"title":"Security \u0026 Compliance","sidebarTitle":"Security","icon":"shield-alt","href":"/enterprise/security"},{"title":"Authentication","sidebarTitle":"Authentication","icon":"key","href":"/enterprise/authentication"},{"title":"Benchmarks","sidebarTitle":"Benchmarks","icon":"tachometer-alt","href":"/enterprise/benchmarks"},{"group":"Deployment","pages":[{"title":"Deployment guide","sidebarTitle":"Overview","icon":"list","href":"/enterprise/deployment/index"},{"title":"Azure deployment guide","sidebarTitle":"Azure","icon":"cloud","href":"/enterprise/deployment/azure"}]}]},{"title":"Performance Tips and Best Practices","sidebarTitle":"Performance Tips","icon":"gauge-high","href":"/performance"}]},{"group":"Model training","pages":[{"title":"Why LanceDB for Training","sidebarTitle":"Why LanceDB for training","icon":"fire","href":"/training/why-lancedb"},{"title":"Loading Data for Model Training","sidebarTitle":"Data Loading","icon":"boxes-stacked","href":"/training/data-loading"},{"title":"PyTorch Integration","sidebarTitle":"PyTorch integration","icon":"fire","href":"/training/torch"},{"title":"LeRobot Native Integration","sidebarTitle":"LeRobot native integration","icon":"robot","href":"/training/lerobot"},{"title":"Object Detection for AV Perception","sidebarTitle":"Example: Object Detection","icon":"car","href":"/training/object-detection"},{"title":"Fine-tuning a VLM on TextVQA","sidebarTitle":"Example: VLM finetuning","icon":"image","href":"/training/vlm-finetuning"}]},{"group":"Guides","pages":[{"group":"Table operations","pages":[{"title":"Basic Table Operations","sidebarTitle":"Basic usage","icon":"table","href":"/tables/index"},{"title":"Ingesting Data","sidebarTitle":"Ingesting data","icon":"cookie","href":"/tables/create"},{"title":"Multimodal Data (Blobs)","sidebarTitle":"Working with multimodal data","icon":"images","href":"/tables/multimodal"},{"title":"Schema and Data Evolution","sidebarTitle":"Schema \u0026 data evolution","icon":"boxes-stacked","href":"/tables/schema"},{"title":"Updating and Modifying Table Data","sidebarTitle":"Update/modify data","icon":"clone","href":"/tables/update"},{"title":"Versioning and Reproducibility","sidebarTitle":"Versioning","icon":"clock","href":"/tables/versioning"},{"title":"Branches","sidebarTitle":"Branches","icon":"code-branch","href":"/tables/branching"},{"title":"Consistency","sidebarTitle":"Consistency","icon":"water","href":"/tables/consistency"}]},{"group":"Namespaces","pages":[{"title":"Namespaces and the Catalog Model","sidebarTitle":"Overview","icon":"sitemap","href":"/namespaces/index"},{"title":"Using Namespaces","sidebarTitle":"Using namespaces","icon":"folder-tree","href":"/namespaces/usage"}]},{"group":"Embeddings","pages":[{"title":"Managing Embeddings","sidebarTitle":"Overview","icon":"bars","href":"/embedding/index"},{"title":"Embeddings: Quickstart","sidebarTitle":"Quickstart","icon":"rocket","href":"/embedding/quickstart"}]},{"group":"Indexing","pages":[{"title":"Indexing Data","sidebarTitle":"Overview","icon":"list","href":"/indexing/index"},{"title":"Vector Indexes","sidebarTitle":"Vector Index","icon":"arrow-up-right-dots","href":"/indexing/vector-index"},{"title":"Quantization","sidebarTitle":"Quantization","icon":"compress","href":"/indexing/quantization"},{"title":"Full-Text Search (FTS) Index","sidebarTitle":"FTS index","icon":"book","href":"/indexing/fts-index"},{"title":"Scalar Indexes","sidebarTitle":"Scalar Index","icon":"tree","href":"/indexing/scalar-index"},{"title":"GPU-Powered Vector Indexing","sidebarTitle":"GPU indexing","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lance-logo-gray.svg","href":"/indexing/gpu-indexing"},{"title":"Keeping Indexes Up-to-Date with Reindexing","sidebarTitle":"Reindexing","icon":"refresh","href":"/indexing/reindexing"}]},{"group":"Search","pages":[{"title":"Search","sidebarTitle":"Overview","icon":"list","href":"/search/index"},{"title":"Vector Search","sidebarTitle":"Vector search","icon":"arrow-up-right-dots","href":"/search/vector-search"},{"title":"Multivector Search","sidebarTitle":"Multivector search","icon":"braille","href":"/search/multivector-search"},{"title":"Full-Text Search (FTS)","sidebarTitle":"Full-Text Search (FTS)","icon":"book","href":"/search/full-text-search"},{"title":"Full-Text Search Examples","sidebarTitle":"FTS Examples","icon":"book-open","href":"/search/fts-examples"},{"title":"Hybrid Search","sidebarTitle":"Hybrid search","description":"Learn how to perform hybrid search in LanceDB by combining vector and full-text search techniques with reranking.","icon":"search","href":"/search/hybrid-search"},{"title":"Metadata Filtering in LanceDB","sidebarTitle":"Filtering","icon":"filter","href":"/search/filtering"},{"title":"Optimize Query Performance","sidebarTitle":"Query optimization","description":"Analyze and optimize query performance in LanceDB.","icon":"gauge","href":"/search/optimize-queries"},{"group":"Enterprise SQL","pages":[{"title":"Query with SQL","sidebarTitle":"SQL","icon":"clipboard-question","href":"/search/sql/index"},{"title":"Full-Text Search with SQL","sidebarTitle":"FTS with SQL","icon":"book","href":"/search/sql/fts-sql"}]}]},{"group":"Reranking","pages":[{"title":"Reranking Search Results","sidebarTitle":"Overview","icon":"sort-amount-down","href":"/reranking/index"},{"title":"Reciprocal Rank Fusion Reranker","sidebarTitle":"RRF Algorithm","href":"/reranking/rrf"},{"title":"Linear Combination Reranker","sidebarTitle":"Linear Combination","href":"/reranking/linear_combination"},{"title":"MRR Reranker","sidebarTitle":"MRR Algorithm","href":"/reranking/mrr"},{"title":"Cross Encoder Reranker","sidebarTitle":"Cross Encoder","href":"/reranking/cross_encoder"},{"title":"Building Custom Rerankers","sidebarTitle":"Custom rerankers","icon":"code","href":"/reranking/custom-reranker"},{"title":"Evaluating Hybrid Search Performance","sidebarTitle":"Evaluation","icon":"chart-bar","href":"/reranking/eval"}]},{"group":"Storage","pages":[{"title":"Storage Architecture in LanceDB","sidebarTitle":"Storage options","icon":"database","href":"/storage/index"},{"title":"Configuring Cloud Storage in LanceDB","sidebarTitle":"Configuring storage","icon":"wrench","href":"/storage/configuration"},{"title":"Monitor LanceDB with OpenTelemetry","sidebarTitle":"Monitoring","icon":"chart-line","href":"/storage/monitoring"}]},{"group":"Build with AI agents","expanded":true,"pages":[{"title":"Tutorial: Use the LanceDB agent plugin","sidebarTitle":"LanceDB agent plugin","icon":"robot","href":"/build-with-ai-agents"},{"title":"Run experiments on branches","sidebarTitle":"Run experiments on branches","icon":"flask","href":"/agent-branch-experiments"}]}]},{"group":"Feature Engineering (Geneva)","pages":[{"title":"Multimodal Feature Engineering with Geneva","sidebarTitle":"Overview","icon":"layer-group","href":"/geneva/index"},{"title":"What is Feature Engineering?","sidebarTitle":"What is feature engineering?","icon":"grip-horizontal","href":"/geneva/overview/index"},{"title":"Getting Started","sidebarTitle":"Getting Started","icon":"rocket","href":"/geneva/getting-started"},{"group":"Transforms","pages":[{"title":"Understanding Transforms","sidebarTitle":"Understanding Transforms","icon":"code-compare","href":"/geneva/udfs/index"},{"title":"User-Defined Functions (UDFs)","sidebarTitle":"UDFs","icon":"function","href":"/geneva/udfs/udfs"},{"title":"Chunkers (Scalar UDTFs)","sidebarTitle":"Chunkers","icon":"diagram-subtask","href":"/geneva/udfs/scalar-udtfs"},{"title":"Batch User-Defined Table Functions (UDTFs)","sidebarTitle":"Batch UDTFs","icon":"layer-group","href":"/geneva/udfs/batch-udtfs"},{"title":"Error Handling in Geneva UDFs","sidebarTitle":"Error Handling","icon":"exclamation","href":"/geneva/udfs/error_handling"},{"title":"Profiling Stateful UDF Memory","sidebarTitle":"Profiling Memory","icon":"chart-line","href":"/geneva/udfs/profiling-memory"},{"title":"Blob Types in Geneva UDFs","sidebarTitle":"Blobs","icon":"splotch","href":"/geneva/udfs/blobs"}]},{"group":"Built-in Transforms","pages":[{"title":"Built-in LLM and Embedding UDFs","sidebarTitle":"Overview","icon":"sparkles","href":"/geneva/udfs/providers/index"},{"title":"OpenAI","sidebarTitle":"OpenAI","icon":"brain","href":"/geneva/udfs/providers/openai"},{"title":"Gemini","sidebarTitle":"Gemini","icon":"google","href":"/geneva/udfs/providers/gemini"},{"title":"Sentence Transformers","sidebarTitle":"Sentence Transformers","icon":"microchip","href":"/geneva/udfs/providers/sentence-transformers"}]},{"group":"Running Jobs","pages":[{"title":"Geneva Jobs","sidebarTitle":"Job execution","href":"/geneva/jobs/index"},{"title":"Backfilling","sidebarTitle":"Backfilling","icon":"fill","href":"/geneva/jobs/backfilling"},{"title":"Bulk Loading \u0026 Updating Columns","sidebarTitle":"Bulk Load / Update Columns","icon":"columns-3","href":"/geneva/jobs/bulk-load-columns"},{"title":"Materialized Views with UDFs","sidebarTitle":"Materialized views","icon":"microscope","href":"/geneva/jobs/materialized-views"},{"title":"Advanced Job Configuration","sidebarTitle":"Advanced job configuration","icon":"sliders","href":"/geneva/jobs/advanced-job-configuration"},{"title":"Job Lifecycle","sidebarTitle":"Job Lifecycle","icon":"arrows-spin","href":"/geneva/jobs/lifecycle"},{"title":"Backfill Conflicts","sidebarTitle":"Backfill Conflicts","icon":"code-merge","href":"/geneva/jobs/conflicts"},{"title":"Distributed Job Performance and Cluster Sizing","sidebarTitle":"Performance and Sizing","icon":"chart-line","href":"/geneva/jobs/performance"},{"title":"Job Metrics (Diagnostics)","sidebarTitle":"Job Metrics","icon":"chart-simple","href":"/geneva/jobs/job_metrics"},{"title":"Geneva Console","sidebarTitle":"Console","icon":"computer","href":"/geneva/jobs/console"},{"title":"Troubleshooting Geneva Jobs","sidebarTitle":"Job troubleshooting","icon":"wrench","href":"/geneva/jobs/troubleshooting"},{"title":"Advanced Execution Contexts","sidebarTitle":"Advanced execution contexts","icon":"circle-nodes","href":"/geneva/jobs/contexts"}]},{"group":"Deployment","pages":[{"title":"Deploy Geneva using Helm","sidebarTitle":"Helm Deployment","icon":"cogs","href":"/geneva/deployment/helm"},{"title":"Job and Session Startup Optimizations","sidebarTitle":"Startup optimizations","icon":"engine","href":"/geneva/jobs/startup"},{"title":"Dependency Verification","sidebarTitle":"Dependency Verification","icon":"magnifying-glass-chart","href":"/geneva/deployment/dependency-verification"},{"title":"Advanced Configuration","sidebarTitle":"Advanced Configuration","icon":"flask-gear","href":"/geneva/udfs/advanced-configuration"},{"title":"Manual Deployment on Kubernetes","sidebarTitle":"Manual Deployment","icon":"cogs","href":"/geneva/deployment/index"},{"title":"Troubleshooting Geneva Deployments","sidebarTitle":"Deployment Troubleshooting","icon":"question-circle","href":"/geneva/deployment/troubleshooting"}]},{"title":"End-to-End Example","sidebarTitle":"End-to-end example","icon":"play","href":"/geneva/end-to-end"},{"title":"Geneva Python SDK","icon":"python","href":"/geneva/reference"}]},{"group":"Support","pages":[{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","icon":"tools","href":"/troubleshooting"},{"group":"FAQ","pages":[{"title":"Frequently Asked Questions","sidebarTitle":"FAQ","icon":"question-circle","href":"/faq/index"},{"title":"LanceDB: Frequently Asked Questions","sidebarTitle":"LanceDB OSS","icon":"code","mode":"wide","href":"/faq/faq-oss"},{"title":"LanceDB Enterprise FAQ","sidebarTitle":"LanceDB Enterprise","icon":"server","mode":"wide","href":"/faq/faq-enterprise"}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/tutorials"}]},{"tab":"Demos","pages":[{"title":"Demos","href":"/demos"}]},{"tab":"Datasets","pages":[{"title":"Datasets","href":"/datasets"}]},{"tab":"Use Cases","pages":[{"title":"Use Cases","href":"/integrations/lerobotdataset"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference"}]}]},"title":"Metadata Filtering in LanceDB - LanceDB","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["10e4515597"],"chunks":["BannerMarkdown-CJDb0dYK.js","dist-Cv_O2fky.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-BGBGWFTt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}