lib/search/word_search: add word count search

This commit is contained in:
2025-05-16 23:50:01 +02:00
parent 080638e7ef
commit b6661c734f
4 changed files with 127 additions and 31 deletions

View File

@@ -27,10 +27,16 @@ class QueryWord extends Command {
libsqlitePath: argResults!.option('libsqlite')!,
);
final String searchWord = 'かな';
final time = Stopwatch()..start();
final result = await JaDBConnection(db).searchWord('かな');
final count = await JaDBConnection(db).searchWordCount(searchWord);
time.stop();
final time2 = Stopwatch()..start();
final result = await JaDBConnection(db).searchWord(searchWord);
time2.stop();
if (result == null) {
print("Invalid search");
} else if (result.isEmpty) {
@@ -42,6 +48,8 @@ class QueryWord extends Command {
}
}
print("Query took ${time.elapsedMilliseconds}ms");
print("Total count: ${count}");
print("Count query took ${time.elapsedMilliseconds}ms");
print("Query took ${time2.elapsedMilliseconds}ms");
}
}