1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
table_create Diaries TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Diaries content COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto
[[0,0.0,0.0],true]
column_create Terms diaries_content COLUMN_INDEX|WITH_POSITION Diaries content
[[0,0.0,0.0],true]
load --table Diaries
[
{"content": "It'll be fine tomorrow as well."},
{"content": "It'll rain tomorrow."},
{"content": "It's fine today. It'll be fine tomorrow as well."},
{"content": "It's fine today. But it'll rain tomorrow."},
{"content": "Ring the bell."},
{"content": "I love dumbbells."}
]
[[0,0.0,0.0],6]
select --table Diaries --match_columns content --query "to*" --output_columns content,_score --sortby _id
[
[
0,
0.0,
0.0
],
[
[
[
4
],
[
[
"content",
"ShortText"
],
[
"_score",
"Int32"
]
],
[
"It'll be fine tomorrow as well.",
1
],
[
"It'll rain tomorrow.",
1
],
[
"It's fine today. It'll be fine tomorrow as well.",
2
],
[
"It's fine today. But it'll rain tomorrow.",
2
]
]
]
]
|