Created
March 13, 2021 21:39
-
-
Save TeddyDD/c5387fedb2c5a6ee7a206a86c1a370c9 to your computer and use it in GitHub Desktop.
Full text seach on files imported from fsdir in SQLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE virtual table file_search using fts5 (path, file, tokenize = 'unicode61'); | |
INSERT into file_search | |
SELECT name, | |
data | |
FROM fsdir('some/path') | |
WHERE name like "%.md"; | |
SELECT path, | |
snippet(file_search, 1, '', '', '...', 5) AS snippet | |
FROM file_search | |
WHERE file_search match 'some query'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment