PageSourceSearch

https://qdrant.tech/js/search/search.min.05337ed95bd35adcc43764bd8…93acc93eac4067bb983a830e62d8098f581646f4.js

js qdrant.tech collected 2026-09-24 07:36:10 UTC 9,330 bytes, 31 lines download raw bytes

1(()=>{(()=>{"use strict";function c(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function h(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,l(t,e))}function d(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,l(t,e),n),n}function l(e,t){return e.get(function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(e,t))}s=new WeakMap,o=new WeakMap;class m{constructor(e){let{modalOuterSelector:n,modalDialogSelector:i,closeBtnSelector:a,resultSelector:r}=e;c(this,s,{writable:!0,value:0[0]}),c(this,o,{writable:!0,value:0[0]}),this.modal=document.querySelector(n),this.dialog=document.querySelector(i),this.openBtns=document.querySelectorAll('[data-target="#searchModal"]'),this.closeBtn=this.modal.querySelector(a),this.result=this.modal.querySelector(r),d(this,s,new Event("qdrModalShow")),d(this,o,new Event("qdrModalHide"));const l=this.show.bind(this),t=this.hide.bind(this);this.openBtns.forEach(e=>e.addEventListener("click",l)),this.modal.addEventListener("click",e=>{const n=this.dialog.contains(e.target)||e.target===this.dialog,s=this.closeBtn.contains(e.target)||e.target===this.closeBtn;n&&!s||t(e)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&t(e)})}show(){this.modal.style.display="block",this.modal.classList.add("active"),document.dispatchEvent(h(this,s))}hide(){const e=this.modal,t=h(this,o);e.classList.remove("active");const n=setTimeout(function(){e.style.display="none",document.dispatchEvent(t),clearTimeout(n)},300)}updateResultChildren(e,t){this.result.replaceChildren(...e),t&&"function"==typeof t&&t()}}function r(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function e(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,u(t,e))}function n(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,u(t,e),n),n}function u(e,t){return e.get(function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(e,t))}var s,o,i=new WeakMap,a=new WeakMap,t=new WeakMap;class f{constructor(s){let{apiUrl:o,section:c,partition:l}=s;r(this,i,{writable:!0,value:0[0]}),r(this,a,{writable:!0,value:0[0]}),r(this,t,{writable:!0,value:0[0]}),this._input=document.querySelector("#searchInput"),this.apiUrl=o,this.section=c,this.partition=l,this._data=[],this._error=0[0],n(this,i,new Event("searchDataIsReady")),n(this,a,0),n(this,t,0),this._input.addEventListener("input",t=>{0===t.target.value.trim().length?(this._data=[],document.dispatchEvent(e(this,i))):this.fetchData(t.target.value)})}get input(){return this._input}set input(e){this._input=e}get data(){return this._data}set data(e){this._data=e}get error(){return this._error}set error(e){this._error=e}fetchData(){if(0===this.input.value.trim().length)return;const o=new URL(this.apiUrl,document.location);o.searchParams.append("q",this.input.value),this.section&&o.searchParams.append("section",this.section),this.partition&&o.searchParams.append("partition",this.partition);let r=e(this,t)+1;n(this,t,e(this,t)+1);const c=setTimeout(()=>{clearTimeout(c),e(this,t)<=r&&fetch(o).then(e=>e.ok?e.json():{result:[],error:e.statusText}).then(t=>{r>e(this,a)&&(n(this,a,r),this.data=t.result,this.error=t?.error,document.dispatchEvent(e(this,i)))}).catch(e=>{this.error=e.message})},100)}}class p{constructor(e){let{searchApiUrl:n,section:s,partition:o}=e;this.apiUrl=n,this.section=s,this.partition=o,this.modal=new m({modalOuterSelector:"#searchModal",modalDialogSelector:".qdr-search__dialog",closeBtnSelector:".qdr-search__close",resultSelector:".qdr-search__results"}),this.searchInput=new f({apiUrl:this.apiUrl,section:this.section,partition:this.partition}),this.activeResultIdx=null;let t=!1;const i=this.setFocusToInput.bind(this);document.addEventListener("qdrModalShow",()=>{i(),t=!0}),document.addEventListener("qdrModalHide",()=>{t=!1}),document.addEventListener("searchDataIsReady",this.updateResult.bind(this));const a=this.navigateTroughResults.bind(this);document.addEventListener("keydown",e=>{t&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),a(e)),"Enter"===e.key&&(e.preventDefault(),function(e){if(!e)return;const t=new MouseEvent("click",{bubbles:!0,cancelable:!0});e.dispatchEvent(t)}(this.modal.result.querySelector('.qdr-search-result[data-key="'.concat(this.activeResultIdx,'"]')))))})}set activeResultIdx(e){this._activeResultIdx=e}get activeResultIdx(){return this._activeResultIdx}generateSearchResult(e){var n;const t=document.createElement("a");t.classList.add("qdr-search-result"),t.href=function(e){var t,n;let o=arguments.length>1&&0[0]!==arguments[1]?arguments[1]:null;const s=new URL(e==null||null===(t=e.payload)||0[0]===t?0[0]:t.url,window.location.origin);return s.searchParams.append("selector",window.btoa(e==null||null===(n=e.payload)||0[0]===n?0[0]:n.location)),o&&s.searchParams.append("q",o),s.toString()}(e,null===(n=this.searchInput.input)||0[0]===n?0[0]:n.value);const s="p"===e.payload.tag?"qdr-search-result__icon":"qdr-search-result__paragraph-icon";return t.innerHTML='<span class="'.concat(s,`"></span>
2                   <div class="qdr-search-result__body"><h5 class="mt-0">`).concat(e?.highlight||e.payload.text,`</h5>
3                   <p>`).concat(e.payload.titles.join(" > "),"</p></div>"),t}updateResult(){const e=[];this.activeResultIdx=null,this.searchInput.data.forEach((t,n)=>{const s=this.generateSearchResult(t);s.dataset.key=n,e.push(s),s.addEventListener("mouseover",e=>{this.activeResultIdx=parseInt(s.dataset.key),this.addActiveClassToResult(this.activeResultIdx)})}),this.modal.updateResultChildren(e,()=>{this.activeResultIdx=0,this.addActiveClassToResult(this.activeResultIdx)})}setFocusToInput(){this.searchInput.input.focus()}addActiveClassToResult(e){const t=this.modal.result.querySelectorAll(".qdr-search-result");
30!==t.length&&([...t].forEach(e=>{e.classList.contains("active")&&e.classList.remove("active")}),[...t].find(t=>parseInt(t.dataset.key)===parseInt(e)).classList.add("active"))}navigateTroughResults(e){let t;"ArrowUp"===e.key&&(t=this.activeResultIdx-1,this.activeResultIdx=t>=0?t:this.searchInput.data.length-1),"ArrowDown"===e.key&&(t=null===this.activeResultIdx?0:this.activeResultIdx+1,t<this.searchInput.data.length?this.activeResultIdx=t:this.activeResultIdx=0),this.addActiveClassToResult(this.activeResultIdx)}}window.initQdrantSearch=function(e){let{searchApiUrl:t,section:n,partition:s}=e;return document.body.appendChild(function(){const e=document.createElement("div");return e.innerHTML=`<div class="qdr-search" id="searchModal" tabindex="-1"
4    aria-labelledby="searchModalLabel" aria-hidden="true">
5    <div class="qdr-search__dialog">
6        <div class="qdr-search__content">
7            <div class="qdr-search__header">
8                <div class="qdr-search__title">
9                    <div class="qdr-search__icon">
10                        <span class="search-icon"></span>
11                    </div>
12                    <input type="text" class="qdr-search__input" autocomplete="off" placeholder="Search..."
13                          id="searchInput" aria-label="Search">
14                </div>
15
16                <button type="button" class="qdr-search__close" aria-label="Close">
17                    <span aria-hidden="true">&times;</span>
18                </button>
19            </div>
20
21            <div class="qdr-search__results"></div>
22
23            <div class="qdr-search__footer"> 
24                <a href="https://qdrant.tech/" target="_blank" rel="nofollow">
25                    Powered by
26                    <span class="qdr-search__logo"></span>
27                </a>
28            </div>
29        </div>
30    </div>
31  </div>`.trim(),e.firstElementChild}()),new p({searchApiUrl:t,section:n,partition:s})}})(),function(){const n=document.querySelector('meta[name="partition"]');let e=n?n.content:null,t;e==="develop"||e==="deploy"?t="develop,deploy,cloud,qdrant":t=e,/documentation|docs/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"documentation",partition:t}),/articles/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"articles",partition:e}),/blog/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"blog",partition:e}),/course/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"course",partition:e}),/learn/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"articles,course,documentation"}),/customers/.test(window.location?.pathname)&&window.initQdrantSearch({searchApiUrl:"https://search.qdrant.tech/api/search",section:"blog",partition:"case-studies"})}()})()

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.