{"componentChunkName":"component---src-templates-simple-markdown-js","path":"/docs/ai/document-ai/semantic-search/","matchPath":"","result":{"data":{"markdownRemark":{"html":"<h1 style=\"position:relative;\"><a href=\"#search\" aria-label=\"search permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"search\"></div>Search</h1>\n<p>Document AI search finds processed content by meaning, exact terms, identifiers, and common spelling variations.</p>\n<p>Search returns page-level matches so users can open the most relevant location in a document.</p>\n<h2 style=\"position:relative;\"><a href=\"#prerequisite\" aria-label=\"prerequisite permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"prerequisite\"></div>Prerequisite</h2>\n<p>A document must be processed with <code class=\"language-text\">embed: true</code> before its content is available to semantic search.</p>\n<p>If a document does not appear:</p>\n<ol>\n<li>\nConfirm its latest applicable run completed.\n</li>\n<li>\nConfirm the selected processing configuration enabled embeddings.\n</li>\n<li>\nCreate a new run with embeddings enabled if needed.\n</li>\n</ol>\n<h2 style=\"position:relative;\"><a href=\"#search-in-shipwell\" aria-label=\"search in shipwell permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"search-in-shipwell\"></div>Search in Shipwell</h2>\n<ol>\n<li>\nOpen \n<strong>Document AI</strong>\n.\n</li>\n<li>\nEnter a phrase, identifier, party name, or document concept in search.\n</li>\n<li>\nApply filters if needed.\n</li>\n<li>\nOpen a result to review the matched page.\n</li>\n</ol>\n<!-- SCREENSHOT PLACEHOLDER\nFile: images/document-search-results.png\nCapture: Search results for a synthetic query such as \"proof of delivery for SW-1001\", showing document, page, match type, and score.\nAlt: Document AI search results\n-->\n<p>Useful searches include:</p>\n<ul>\n<li>\n<code class=\"language-text\">proof of delivery</code>\n</li>\n<li>\n<code class=\"language-text\">BOL-10482</code>\n</li>\n<li>\n<code class=\"language-text\">documents mentioning detention</code>\n</li>\n<li>\nA carrier, shipper, or consignee name\n</li>\n<li>\nA sentence describing the information you need\n</li>\n</ul>\n<h2 style=\"position:relative;\"><a href=\"#search-through-the-api\" aria-label=\"search through the api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"search-through-the-api\"></div>Search through the API</h2>\n<p>Use one or more <code class=\"language-text\">q</code> parameters:</p>\n\n      <div class=\"code-snippets-tabs\" >\n    <div class=\"snippets-tabs-headers\">\n      <span class=\"tab-header active\" data-lang=\"curl\" data-snippet-id=\"curl\">curl</span><span class=\"tab-header \" data-lang=\"python\" data-snippet-id=\"python\">python</span>\n    </div>\n    <div class=\"snippets-tabs-contents\">\n      <div class=\"tab-content active\" data-lang=\"curl\" data-snippet-id=\"curl\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"71336983350040550000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`curl --get \\\\\n  &quot;https://sandbox-api.shipwell.com/document-store/documents:search&quot; \\\\\n  -H &quot;Authorization: Token <user-token>&quot; \\\\\n  --data-urlencode &quot;q=proof of delivery for SW-1001&quot; \\\\\n  --data-urlencode &quot;page=1&quot; \\\\\n  --data-urlencode &quot;page_size=25&quot;`, `71336983350040550000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-71336983350040550000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"curl\"><pre class=\"language-curl\"><code class=\"language-curl\">curl --get \\\n  &quot;https://sandbox-api.shipwell.com/document-store/documents:search&quot; \\\n  -H &quot;Authorization: Token &lt;user-token&gt;&quot; \\\n  --data-urlencode &quot;q=proof of delivery for SW-1001&quot; \\\n  --data-urlencode &quot;page=1&quot; \\\n  --data-urlencode &quot;page_size=25&quot;</code></pre></div>\n      </div></div><div class=\"tab-content \" data-lang=\"python\" data-snippet-id=\"python\"><div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"79063400136142010000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`import requests\n\nresponse = requests.get(\n    &quot;https://sandbox-api.shipwell.com/document-store/documents:search&quot;,\n    headers={&quot;Authorization&quot;: &quot;Token <user-token>&quot;},\n    params={\n        &quot;q&quot;: &quot;proof of delivery for SW-1001&quot;,\n        &quot;page&quot;: 1,\n        &quot;page_size&quot;: 25,\n    },\n    timeout=30,\n)\nresponse.raise_for_status()\nresults = response.json()`, `79063400136142010000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-79063400136142010000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-python\"><code class=\"language-python\"><span class=\"token keyword\">import</span> requests\n\nresponse <span class=\"token operator\">=</span> requests<span class=\"token punctuation\">.</span>get<span class=\"token punctuation\">(</span>\n    <span class=\"token string\">\"https://sandbox-api.shipwell.com/document-store/documents:search\"</span><span class=\"token punctuation\">,</span>\n    headers<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span><span class=\"token string\">\"Authorization\"</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"Token &lt;user-token>\"</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    params<span class=\"token operator\">=</span><span class=\"token punctuation\">{</span>\n        <span class=\"token string\">\"q\"</span><span class=\"token punctuation\">:</span> <span class=\"token string\">\"proof of delivery for SW-1001\"</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"page\"</span><span class=\"token punctuation\">:</span> <span class=\"token number\">1</span><span class=\"token punctuation\">,</span>\n        <span class=\"token string\">\"page_size\"</span><span class=\"token punctuation\">:</span> <span class=\"token number\">25</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    timeout<span class=\"token operator\">=</span><span class=\"token number\">30</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">)</span>\nresponse<span class=\"token punctuation\">.</span>raise_for_status<span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\nresults <span class=\"token operator\">=</span> response<span class=\"token punctuation\">.</span>json<span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span></code></pre></div>\n      </div></div>\n    </div></div>\n    \n<p>The response includes:</p>\n<ul>\n<li>\n<code class=\"language-text\">data</code>\n — page-level search hits\n</li>\n<li>\n<code class=\"language-text\">count</code>\n — total matching hits\n</li>\n<li>\nPagination links\n</li>\n<li>\n<code class=\"language-text\">queries</code>\n — query variants used for the request\n</li>\n</ul>\n<p>A hit includes:</p>\n<ul>\n<li>\n<code class=\"language-text\">document_id</code>\n and \n<code class=\"language-text\">filename</code>\n</li>\n<li>\n<code class=\"language-text\">page_number</code>\n</li>\n<li>\nA matching \n<code class=\"language-text\">content_text</code>\n snippet\n</li>\n<li>\n<code class=\"language-text\">relevance</code>\n</li>\n<li>\nMatch signals such as \n<code class=\"language-text\">exact_score</code>\n</li>\n<li>\n<code class=\"language-text\">run_id</code>\n and \n<code class=\"language-text\">result_id</code>\n</li>\n<li>\nDocument status and type when available\n</li>\n<li>\nDocument associations in \n<code class=\"language-text\">entities</code>\n</li>\n</ul>\n<p>Use <code class=\"language-text\">document_id</code>, <code class=\"language-text\">result_id</code>, and <code class=\"language-text\">page_number</code> to open or inspect the matching source page.</p>\n<h2 style=\"position:relative;\"><a href=\"#filter-results\" aria-label=\"filter results permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"filter-results\"></div>Filter results</h2>\n<p>Available filters include:</p>\n<table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Use</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">document_id</code></td>\n<td>Search within one document.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">content_type</code></td>\n<td>Restrict results to a MIME type.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">entity_type</code></td>\n<td>Restrict results by association type. Repeat to include multiple values.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">entity_id</code></td>\n<td>Restrict results by association identifier. Repeat to include multiple values.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">status</code></td>\n<td>Restrict results by document status. Repeat to include multiple values.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">document_type</code></td>\n<td>Restrict results by detected document type. Repeat to include multiple values.</td>\n</tr>\n</tbody>\n</table>\n<p>For example, use <code class=\"language-text\">entity_type=shipment</code> and <code class=\"language-text\">entity_id=SW-1001</code> to search documents associated with one shipment.</p>\n<h2 style=\"position:relative;\"><a href=\"#multiple-query-variants\" aria-label=\"multiple query variants permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"multiple-query-variants\"></div>Multiple query variants</h2>\n<p>Repeat <code class=\"language-text\">q</code> to submit up to eight alternative descriptions:</p>\n<div class=\"code-wrapper\">\n        <div class=\"gatsby-code-button-container\"\n             data-toaster-id=\"24887946402160144000\"\n             data-toaster-duration=\"1500\"\n             onClick=\"copyCodeToClipboard(`?q=proof+of+delivery&q=delivery+receipt&q=signed+POD`, `24887946402160144000`)\"\n        >\n          <div class=\"gatsby-code-button\" title=\"Copy the code snippet\">Copy</div>\n          <div class=\"done-indicator done-indicator-24887946402160144000\">Copied</div>\n        </div>\n        <div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">?q=proof+of+delivery&amp;q=delivery+receipt&amp;q=signed+POD</code></pre></div>\n      </div>\n<p>Variants are useful when your application knows domain-specific alternatives. Put the user's original query first.</p>\n<h2 style=\"position:relative;\"><a href=\"#relevance-controls\" aria-label=\"relevance controls permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"relevance-controls\"></div>Relevance controls</h2>\n<ul>\n<li>\n<code class=\"language-text\">rerank</code>\n defaults to \n<code class=\"language-text\">true</code>\n for higher-precision ordering.\n</li>\n<li>\nSet \n<code class=\"language-text\">rerank=false</code>\n when lower latency is more important than refined ordering.\n</li>\n<li>\n<code class=\"language-text\">min_relevance</code>\n controls the relevance floor when reranking is enabled.\n</li>\n<li>\n<code class=\"language-text\">min_similarity</code>\n controls the semantic similarity floor.\n</li>\n<li>\n<code class=\"language-text\">snippet_chars</code>\n limits the returned text for each hit. Set it to \n<code class=\"language-text\">0</code>\n to return scores without snippets.\n</li>\n</ul>\n<p>Start with the defaults. Tune thresholds only after evaluating representative searches; high thresholds can remove useful results.</p>\n<h2 style=\"position:relative;\"><a href=\"#pagination\" aria-label=\"pagination permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"pagination\"></div>Pagination</h2>\n<ul>\n<li>\n<code class=\"language-text\">page</code>\n is 1-indexed.\n</li>\n<li>\n<code class=\"language-text\">page_size</code>\n defaults to 25 and supports up to 100.\n</li>\n<li>\nFollow \n<code class=\"language-text\">next</code>\n, \n<code class=\"language-text\">previous</code>\n, or the structured \n<code class=\"language-text\">links</code>\n object rather than constructing pagination URLs manually.\n</li>\n</ul>\n<h2 style=\"position:relative;\"><a href=\"#search-safety\" aria-label=\"search safety permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><div class=\"hidden-anchor\" id=\"search-safety\"></div>Search safety</h2>\n<p>Search results are evidence, not a final business decision. Before automating a high-impact action:</p>\n<ol>\n<li>\nRetrieve the matching document and page.\n</li>\n<li>\nVerify the relevant extracted value or source text.\n</li>\n<li>\nApply your workflow's validation and authorization rules.\n</li>\n</ol>","headings":[{"value":"Search","depth":1},{"value":"Prerequisite","depth":2},{"value":"Search in Shipwell","depth":2},{"value":"Search through the API","depth":2},{"value":"Filter results","depth":2},{"value":"Multiple query variants","depth":2},{"value":"Relevance controls","depth":2},{"value":"Pagination","depth":2},{"value":"Search safety","depth":2}]},"contentItem":{"data":{"lastModified":"2026-07-17T16:00:10.000Z","enableToc":null,"disableLastModified":null,"tocMaxDepth":null,"requestLogin":false}},"siteConfig":{"enableToc":true,"disableLastModified":false,"tocMaxDepth":4}},"pageContext":{"matchPath":"","id":"2f23a3ac-4c3a-5779-8ab5-2284b8845ef0__redocly content/docs/ai/document-ai/semantic-search/","seo":{"title":"Search","description":null,"image":"","keywords":null,"jsonLd":null,"lang":null,"siteUrl":null},"pageId":"docs/ai/document-ai/semantic-search.md","pageBaseUrl":"/docs/ai/document-ai/semantic-search","type":"markdown","toc":{"enable":true,"maxDepth":4,"headings":[{"depth":1,"value":"Search","id":"search"},{"depth":2,"value":"Prerequisite","id":"prerequisite"},{"depth":2,"value":"Search in Shipwell","id":"search-in-shipwell"},{"depth":2,"value":"Search through the API","id":"search-through-the-api"},{"depth":2,"value":"Filter results","id":"filter-results"},{"depth":2,"value":"Multiple query variants","id":"multiple-query-variants"},{"depth":2,"value":"Relevance controls","id":"relevance-controls"},{"depth":2,"value":"Pagination","id":"pagination"},{"depth":2,"value":"Search safety","id":"search-safety"}]},"data":{"title":"Search"},"catalogInfo":null,"link":"/docs/ai/document-ai/semantic-search/","sidebarName":"developerPortal","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":null,"apiVersionId":null,"isDefaultApiVersion":null}},"staticQueryHashes":["1123603147","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3240152602","3743992808","561138138"]}