Browse Source

Update fuzzysearchdatabase and tweak Module Browser search.

tags/v2.2.0
Andrew Belt 1 year ago
parent
commit
73eead277e
2 changed files with 5 additions and 6 deletions
  1. +1
    -1
      dep/fuzzysearchdatabase
  2. +4
    -5
      src/app/Browser.cpp

+ 1
- 1
dep/fuzzysearchdatabase

@@ -1 +1 @@
Subproject commit fe62479811e503ef3c091f5a859d27bfcf0a44da
Subproject commit a3a1bf557b8e6ee58b55fa82ff77ff7a3d141949

+ 4
- 5
src/app/Browser.cpp View File

@@ -45,8 +45,8 @@ static fuzzysearch::Database<plugin::Model*> modelDb;


static void modelDbInit() { static void modelDbInit() {
modelDb = fuzzysearch::Database<plugin::Model*>(); modelDb = fuzzysearch::Database<plugin::Model*>();
modelDb.setWeights({1.f, 1.f, 0.1f, 1.f, 0.5f, 0.5f});
modelDb.setThreshold(0.25f);
modelDb.setWeights({1.0f, 1.0f, 1.0f, 0.8f, 1.0f});
modelDb.setThreshold(0.5f);


// Iterate plugins // Iterate plugins
for (plugin::Plugin* plugin : plugin::plugins) { for (plugin::Plugin* plugin : plugin::plugins) {
@@ -58,18 +58,17 @@ static void modelDbInit() {
// Add all aliases of a tag // Add all aliases of a tag
for (const std::string& tagAlias : tag::tagAliases[tagId]) { for (const std::string& tagAlias : tag::tagAliases[tagId]) {
tagStr += tagAlias; tagStr += tagAlias;
tagStr += ", ";
tagStr += " ";
} }
} }
std::vector<std::string> fields = { std::vector<std::string> fields = {
model->plugin->brand, model->plugin->brand,
model->plugin->name, model->plugin->name,
model->plugin->description,
model->name, model->name,
model->description, model->description,
tagStr, tagStr,
}; };
// DEBUG("%s; %s; %s; %s; %s; %s", fields[0].c_str(), fields[1].c_str(), fields[2].c_str(), fields[3].c_str(), fields[4].c_str(), fields[5].c_str());
// DEBUG("%s; %s; %s; %s; %s; %s", fields[0].c_str(), fields[1].c_str(), fields[2].c_str(), fields[3].c_str(), fields[4].c_str());
modelDb.addEntry(model, fields); modelDb.addEntry(model, fields);
} }
} }


Loading…
Cancel
Save