mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-10-01 07:36:40 +02:00
Fix options being detected as fields
- Fix clean job to work on UNIX based systems - Fix build.js to work on UNIX based systems
This commit is contained in:
2
dist/flexsearch.bundle.js
vendored
2
dist/flexsearch.bundle.js
vendored
@@ -27,7 +27,7 @@ function U(a,b,c,d,e){a=a[e];if(d===c.length-1)b[e]=a;else if(a)if(a.constructor
|
||||
t.add=function(a,b,c){C(a)&&(b=a,a=T(b,this.key));if(b&&(a||0===a)){if(!c&&this.register[a])return this.update(a,b);for(let d=0,e,f;d<this.h.length;d++)f=this.h[d],e=this.K[d],x(e)&&(e=[e]),V(b,e,this.A,0,this.index[f],a,e[0],c);if(this.I){let d=T(b,this.I),e=v();x(d)&&(d=[d]);for(let f=0,g,h;f<d.length;f++)if(g=d[f],!e[g]&&(e[g]=1,h=this.l[g]||(this.l[g]=[]),!c||-1===h.indexOf(a)))if(h[h.length]=a,this.m){const k=this.register[a]||(this.register[a]=[]);k[k.length]=h}}if(this.store&&(!c||!this.store[a])){let d;
|
||||
if(this.G){d=v();for(let e=0,f;e<this.G.length;e++)f=this.G[e],x(f)?d[f]=b[f]:U(b,d,f,0,f[0])}this.store[a]=d||b}}return this};t.append=function(a,b){return this.add(a,b,!0)};t.update=function(a,b){return this.remove(a).add(a,b)};
|
||||
t.remove=function(a){C(a)&&(a=T(a,this.key));if(this.register[a]){for(var b=0;b<this.h.length&&(this.index[this.h[b]].remove(a,!this.o),!this.m);b++);if(this.I&&!this.m)for(let c in this.l){b=this.l[c];const d=b.indexOf(a);-1!==d&&(1<b.length?b.splice(d,1):delete this.l[c])}this.store&&delete this.store[a];delete this.register[a]}return this};
|
||||
t.search=function(a,b,c,d){C(a)?(c=a,a=c.query):C(b)&&(c=b,b=0);let e=[],f=[],g,h,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{k=(g=c.pluck)||c.index||c.field||c;m=c.tag;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||100;w=c.offset||0;if(m&&(x(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=za.call(this,m[l],b,w,h))e[e.length]=p,q++;return q?e:[]}x(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,z,B;l<k.length;l++){let A;
|
||||
t.search=function(a,b,c,d){C(a)?(c=a,a=c.query):C(b)&&(c=b,b=0);let e=[],f=[],g,h,k,m,n,w,q=0;if(c)if(c.constructor===Array)k=c,c=null;else{k=(g=c.pluck)||c.index||c.field;m=c.tag;h=this.store&&c.enrich;n="and"===c.bool;b=c.limit||100;w=c.offset||0;if(m&&(x(m)&&(m=[m]),!a)){for(let l=0,p;l<m.length;l++)if(p=za.call(this,m[l],b,w,h))e[e.length]=p,q++;return q?e:[]}x(k)&&(k=[k])}k||(k=this.h);n=n&&(1<k.length||m&&1<m.length);const r=!d&&(this.o||this.async)&&[];for(let l=0,p,z,B;l<k.length;l++){let A;
|
||||
z=k[l];x(z)||(A=z,z=z.field);if(r)r[l]=this.index[z].searchAsync(a,b,A||c);else{d?p=d[l]:p=this.index[z].search(a,b,A||c);B=p&&p.length;if(m&&B){const y=[];let H=0;n&&(y[0]=[p]);for(let X=0,qa,R;X<m.length;X++)if(qa=m[X],B=(R=this.l[qa])&&R.length)H++,y[y.length]=n?[R]:R;H&&(p=n?na(y,b||100,w||0):oa(p,y),B=p.length)}if(B)f[q]=z,e[q++]=p;else if(n)return[]}}if(r){const l=this;return new Promise(function(p){Promise.all(r).then(function(z){p(l.search(a,b,c,z))})})}if(!q)return[];if(g&&(!h||!this.store))return e[0];
|
||||
for(let l=0,p;l<f.length;l++){p=e[l];p.length&&h&&(p=Aa.call(this,p));if(g)return p;e[l]={field:f[l],result:p}}return e};function za(a,b,c,d){let e=this.l[a],f=e&&e.length-c;if(f&&0<f){if(f>b||c)e=e.slice(c,c+b);d&&(e=Aa.call(this,e));return{tag:a,result:e}}}function Aa(a){const b=Array(a.length);for(let c=0,d;c<a.length;c++)d=a[c],b[c]={id:d,doc:this.store[d]};return b}t.contain=function(a){return!!this.register[a]};t.get=function(a){return this.store[a]};t.set=function(a,b){this.store[a]=b;return this};
|
||||
t.searchCache=pa;t.export=function(a,b,c,d,e){e||(e=0);d||(d=0);if(d<this.h.length){const f=this.h[d],g=this.index[f];b=this;setTimeout(function(){g.export(a,b,e?f.replace(":","-"):"",d,e++)||(d++,e=1,b.export(a,b,f,d,e))})}else{let f;switch(e){case 1:c="tag";f=this.l;break;case 2:c="store";f=this.store;break;default:return}sa(a,this,c,d,e,f)}};
|
||||
|
Reference in New Issue
Block a user