mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-02 18:33:17 +02:00
MOD update readme, minor cleanup
This commit is contained in:
@@ -70,6 +70,10 @@ In this way contextual search <a href="https://rawgit.com/nextapps-de/flexsearch
|
||||
|
||||
__Note:__ This feature is actually not enabled by default.
|
||||
|
||||
###### TF-IDF / BM25?
|
||||
|
||||
> "TF-IDF and all kinds of variations (like BM25) is a big mistake in searching algorithm today. They does'nt provide either: a meaningful relevance of a term as well as the importance of it! Like many pseudo-intelligent algorithm this is also an example of mathematical stupidity." — Thomas Wilkerling, _Contextual-based Scoring_, 2018
|
||||
|
||||
<a name="webworker"></a>
|
||||
#### Web-Worker Support
|
||||
|
||||
|
@@ -316,18 +316,6 @@ var SUPPORT_ASYNC = true;
|
||||
|
||||
if(self._current_callback && (self._task_completed === self.worker)){
|
||||
|
||||
// if(typeof self._last_empty_query !== 'undefined'){
|
||||
//
|
||||
// if(self._task_result.length){
|
||||
//
|
||||
// self._last_empty_query = "";
|
||||
// }
|
||||
// else{
|
||||
//
|
||||
// self._last_empty_query || (self._last_empty_query = query);
|
||||
// }
|
||||
// }
|
||||
|
||||
// store result to cache
|
||||
|
||||
if(self.cache){
|
||||
@@ -447,11 +435,6 @@ var SUPPORT_ASYNC = true;
|
||||
this._timer = null;
|
||||
this._status = true;
|
||||
|
||||
// if(this.mode === 'forward' || this.mode === 'reverse' || this.mode === 'both'){
|
||||
//
|
||||
// this._last_empty_query = "";
|
||||
// }
|
||||
|
||||
if(SUPPORT_CACHE) {
|
||||
|
||||
this.cache = custom = (
|
||||
@@ -951,11 +934,6 @@ var SUPPORT_ASYNC = true;
|
||||
|
||||
if(SUPPORT_CACHE && this.cache){
|
||||
|
||||
// if(typeof this._last_empty_query !== 'undefined'){
|
||||
//
|
||||
// this._last_empty_query = "";
|
||||
// }
|
||||
|
||||
this._cache.reset();
|
||||
}
|
||||
|
||||
@@ -974,13 +952,6 @@ var SUPPORT_ASYNC = true;
|
||||
}
|
||||
}
|
||||
|
||||
// validate last query
|
||||
|
||||
// else if((typeof this._last_empty_query !== 'undefined') && this._last_empty_query && (query.indexOf(this._last_empty_query) === 0)){
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
|
||||
// encode string
|
||||
|
||||
_query = this.encode(/** @type {string} */ (_query));
|
||||
@@ -1082,6 +1053,7 @@ var SUPPORT_ASYNC = true;
|
||||
|
||||
count > 1 ?
|
||||
|
||||
// https://jsperf.com/merge-arrays-comparison
|
||||
check.concat.apply([], map_check)
|
||||
:
|
||||
map_check[0]
|
||||
@@ -1114,18 +1086,6 @@ var SUPPORT_ASYNC = true;
|
||||
//result = intersect_3d(check, limit, this.suggest);
|
||||
}
|
||||
|
||||
// if(typeof this._last_empty_query !== 'undefined'){
|
||||
//
|
||||
// if(result.length){
|
||||
//
|
||||
// this._last_empty_query = "";
|
||||
// }
|
||||
// else{
|
||||
//
|
||||
// this._last_empty_query || (this._last_empty_query = query);
|
||||
// }
|
||||
// }
|
||||
|
||||
// store result to cache
|
||||
|
||||
if(SUPPORT_CACHE && this.cache){
|
||||
@@ -2252,9 +2212,11 @@ var SUPPORT_ASYNC = true;
|
||||
}
|
||||
else if(length_z){
|
||||
|
||||
result = result.concat.apply(result, arrays[0]);
|
||||
arrays = arrays[0];
|
||||
|
||||
if(limit && result && (result.length > limit)){
|
||||
result = arrays.length > 1 ? result.concat.apply(result, arrays) : arrays[0];
|
||||
|
||||
if(limit && (result.length > limit)){
|
||||
|
||||
// Note: do not touch original array!
|
||||
|
||||
@@ -2274,6 +2236,7 @@ var SUPPORT_ASYNC = true;
|
||||
* @returns {Array}
|
||||
*/
|
||||
|
||||
/*
|
||||
function intersect_sorted(a, b, limit){
|
||||
|
||||
var result = [];
|
||||
@@ -2319,6 +2282,7 @@ var SUPPORT_ASYNC = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {FlexSearch} ref
|
||||
|
@@ -52,10 +52,10 @@
|
||||
"chai": "^4.1.2",
|
||||
"coveralls": "^3.0.0",
|
||||
"google-closure-compiler": "^20180402.0.0",
|
||||
"mocha": "^5.0.5",
|
||||
"mocha": "^5.1.1",
|
||||
"mocha-lcov-reporter": "^1.3.0",
|
||||
"mocha-phantomjs": "^4.1.0",
|
||||
"nyc": "^11.6.0",
|
||||
"nyc": "^11.7.1",
|
||||
"phantomjs-prebuilt": "^2.1.16",
|
||||
"updtr": "^2.0.0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user