1import{q as u,h as g}from"./CnnyFAvh.js";import{C as e}from"./DpmvSwkS.js";class f{_logger;_host;_port;_proxyHost;_proxyPort;_collection;init(t){this._logger=t.logger,this._host=t.host,this._port=t.port??8983,this._proxyHost=t.proxyHost,this._proxyPort=t.proxyPort}useCollection(t){this._collection=t}createCollection(t){return this.call({path:"admin/collections",params:{action:"CREATE",numShards:t.numShards,replicationFactor:t.replicationFactor,name:t.collection,"collection.configName":t.configSet},method:"POST"})}updateDocuments(t){return this.call({path:this._collection+"/update",body:t.documents,method:"POST"})}changeAlias(t){return this.call({path:"admin/collections",params:{action:"CREATEALIAS",name:t.alias,collections:t.collection},method:"POST"})}getCollections(){return this.call({path:"admin/collections",params:{action:"LIST"},method:"GET"})}deleteCollection(t){return this.call({path:"admin/collections",params:{action:"DELETE",name:t.name},method:"POST"})}query(t){let i=t.filterQueries??[];return t.distance&&i.push("{!geofilt sfield="+t.distance.field+"}"),this.call({path:this._collection+"/query",params:{q:t.query,start:t.start??0,rows:t.rows??100,fl:t.fields?t.fields.join(","):void 0,fq:i.length>0?t.filterQueries:void 0,sort:t.sorts?t.sorts.join(","):void 0,pt:t.coordinates?.location,sfield:t.coordinates?.field},method:"POST"})}logDebug(t){this._logger&&this._logger.debug(t)}logError(t){this._logger&&this._logger.error(t)}call(t){return new Promise((i,c)=>{const a=this._host+":"+this._port+"/solr/"+t.path+"?"+u.stringify(t.params,{arrayFormat:"repeat"}),d={hostname:this._proxyHost,port:this._proxyPort,path:a,method:t.method,json:!0,headers:{"Content-type":"application/json"}},l=g.request(d,r=>{let s=[];r.on("data",n=>{s.push(n)}),r.on("end",()=>{try{s=JSON.parse(Buffer.concat(s).toString())}catch(n){this.logError(n.message),c(n)}i(s)})});l.on("error",r=>{this.logError(r.message),c()}),t.body&&l.write(JSON.stringify(t.body)),l.end()})}}const p="seo-business-register";function y(){return e.solr.aliasPrefix+"--"+p}const _="seo-land-register";function m(){return e.solr.aliasPrefix+"--"+_}function h(o){const t=new f;return t.init({logger:o?.logger,host:e.solr.host,port:e.solr.port,proxyHost:e.solr.proxyHost,proxyPort:e.solr.proxyPort}),t}function A(){const o=h();return o.useCollection(y()),o}function E(){const o=h();return o.useCollection(m()),o}export{E as a,A as b};
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.