Increase default capacity in SearchIndexWrapper and enhance similarity calculation in calculate_similarity function to boost similarity score when all query words are found. Update MAX_WORDS and MAX_STRING_LEN definitions for improved handling.

This commit is contained in:
seb
2025-04-18 09:16:26 +02:00
parent ca2c86ce33
commit 6091cc0b80
3 changed files with 25 additions and 8 deletions

View File

@@ -41,7 +41,7 @@ SearchIndexWrapper::SearchIndexWrapper(const Napi::CallbackInfo& info)
Napi::Env env = info.Env();
Napi::HandleScope scope(env);
int capacity = 500; // Default capacity
int capacity = 10000; // Increased default capacity from 500 to 10000
if (info.Length() > 0 && info[0].IsNumber()) {
capacity = info[0].As<Napi::Number>().Int32Value();
}