PageSourceSearch

https://autocontext.ai/assets/orama-cloud-DuqhZmr4.js

js autocontext.ai collected 2026-10-05 11:51:26 UTC 1,289 bytes, 1 lines download raw bytes

1import{c as p}from"./index-CGbSpai4.js";import{r as g}from"./remove-undefined-Cxnv4ZZs-oajMeTFk.js";import"./search-default-BCpXohqP.js";import"./main-CtuSTsQT.js";import"./index-CVENOxyJ.js";function _(u){const{index:l="default",client:c,params:o,tag:n}=u;return{deps:[l,c,n],async search(d){const s=p(d),e=[];if(l==="crawler"){const a=await c.search({datasources:[],...o,term:d,where:{category:n?{eq:n.slice(0,1).toUpperCase()+n.slice(1)}:void 0,...o?.where},limit:10});if(!a)return e;for(const r of a.hits){const i=r.document;e.push({id:r.id,type:"page",content:s.highlightMarkdown(i.title),url:i.path},{id:"page"+r.id,type:"text",content:s.highlightMarkdown(i.content),url:i.path})}return e}const h=await c.search({datasources:[],...o,term:d,limit:20,where:g({tag:n,...o?.where}),groupBy:{properties:["page_id"],max_results:7,...o?.groupBy}});if(!h||!h.groups)return e;for(const a of h.groups){let r=!1;for(const i of a.result){const t=i.document;r||(e.push({id:t.page_id,type:"page",content:s.highlightMarkdown(t.title),breadcrumbs:t.breadcrumbs,url:t.url}),r=!0),e.push({id:t.id,content:s.highlightMarkdown(t.content),type:t.content===t.section?"heading":"text",url:t.section_id?`${t.url}#${t.section_id}`:t.url})}}return e.length>80?e.slice(0,80):e}}}export{_ as oramaCloudClient};

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.