Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor example directory #322

Merged
merged 7 commits into from
Apr 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: more description about its functionality (FTS on SQLite3)
  • Loading branch information
KEINOS committed Apr 13, 2024
commit 9b43806b7bdf36f7c3e03ebb2c1e71e11a9565fe
10 changes: 8 additions & 2 deletions _examples/db_search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ Searching for: 北

## Details

In this example, each line of text is inserted into a row of the SQLite3 database, and then the database is searched for the word "人魚" and "".
In this example, each line of text is inserted into a row of the SQLite3 database, and then the database is searched for the word "人魚", "人", "北方" and "".

Note that the string tokenized by Kagome, a.k.a. "Wakati", is recorded in a separate table for [FTS4](https://www.sqlite.org/fts3.html) (Full-Text-Search) at the same time as the original text.
When inserting text data into the database, Kagome is used to tokenize the text into words.

The string (or a line) tokenized by Kagome, a.k.a. "Wakati", is recorded in a separate table for [FTS4](https://www.sqlite.org/fts3.html) (Full-Text-Search) relative to the original text.

This allows Unicode text data that is not separated by spaces, such as Japanese, to be searched by FTS.

Note that it is searching by word and not by character. For example "人" doesn't match "人魚". Likewise, "北" doesn't match "北方".

This is due to the fact that the FTS4 module in SQLite3 is designed to search for words, not characters.

### Aim of this example

This example can be useful in scenarios where you need to perform full-text searches on Japanese text.
Expand Down