mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-25 04:51:29 +02:00
disable post-filter after stemmer
This commit is contained in:
19
dist/module-debug/encoder.js
vendored
19
dist/module-debug/encoder.js
vendored
@@ -439,15 +439,22 @@ Encoder.prototype.encode = function (str) {
|
||||
// }
|
||||
this.stemmer_test || (this.stemmer_test = new RegExp("(?!^)(" + this.stemmer_str + ")$"));
|
||||
|
||||
const old = word;
|
||||
//const old = word;
|
||||
word = word.replace(this.stemmer_test, match => this.stemmer.get(match));
|
||||
|
||||
// if(old !== word && word.length > 2){
|
||||
// word = word.replace(this.stemmer_test, match => this.stemmer.get(match));
|
||||
// }
|
||||
|
||||
// 4. post-filter after stemmer was applied
|
||||
if (old !== word && this.filter && word.length >= this.minlength) {
|
||||
if ("function" == typeof this.filter ? !this.filter(word) : this.filter.has(word)) {
|
||||
word = "";
|
||||
}
|
||||
}
|
||||
// if(old !== word && this.filter && word.length >= this.minlength){
|
||||
// if(typeof this.filter === "function"
|
||||
// ? !this.filter(word)
|
||||
// : this.filter.has(word)
|
||||
// ){
|
||||
// word = "";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// apply mapper and collapsing
|
||||
|
2
dist/module-debug/index.js
vendored
2
dist/module-debug/index.js
vendored
@@ -55,7 +55,7 @@ export default function Index(options, _register) {
|
||||
this.fastupdate = !!options.fastupdate;
|
||||
this.score = options.score || null;
|
||||
|
||||
if (context && "strict" !== this.tokenize) {
|
||||
if (context && context.depth && "strict" !== this.tokenize) {
|
||||
console.warn("Context-Search could not applied, because it is just supported when using the tokenizer \"strict\".");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user