Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
25
Task/Inverted-index/DuckDB/inverted-index.duckdb
Normal file
25
Task/Inverted-index/DuckDB/inverted-index.duckdb
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
install fts; -- once should be enough
|
||||
|
||||
load fts;
|
||||
create or replace table texts as (from read_text('inv*.txt'));
|
||||
|
||||
pragma create_fts_index(
|
||||
'texts', -- table name
|
||||
'filename', -- column name
|
||||
'content', -- column name of text
|
||||
stemmer = 'english',
|
||||
stopwords = 'none',
|
||||
strip_accents = 1,
|
||||
lower = 1, -- ignore case
|
||||
overwrite = 1);
|
||||
|
||||
# Simple interface to match_bm25 for conjunctive queries:
|
||||
create or replace function s(queryString) as table (
|
||||
select filename,
|
||||
content,
|
||||
fts_main_texts.match_bm25( filename,
|
||||
queryString,
|
||||
conjunctive := 1) as score
|
||||
from texts
|
||||
where score IS NOT NULL
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue