diff --git a/Cargo.lock b/Cargo.lock index 989eb1dbf4220..40008eb83ece8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11692,7 +11692,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "ownedbytes" version = "0.9.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "stable_deref_trait", ] @@ -15459,7 +15459,7 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tantivy" version = "0.26.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "aho-corasick", "arc-swap", @@ -15511,7 +15511,7 @@ dependencies = [ [[package]] name = "tantivy-bitpacker" version = "0.9.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "bitpacking 0.9.2", ] @@ -15519,7 +15519,7 @@ dependencies = [ [[package]] name = "tantivy-columnar" version = "0.6.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "downcast-rs", "fastdivide", @@ -15534,7 +15534,7 @@ dependencies = [ [[package]] name = "tantivy-common" version = "0.10.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "async-trait", "byteorder", @@ -15557,7 +15557,7 @@ dependencies = [ [[package]] name = "tantivy-jieba" version = "0.17.0" -source = "git+https://github.com/datafuse-extras/tantivy-jieba?rev=18a0ae9#18a0ae9a444502b042fb01244afc5044df39287a" +source = "git+https://github.com/datafuse-extras/tantivy-jieba?rev=68ab55c#68ab55c7015479828456ba339528183cb4635478" dependencies = [ "jieba-rs", "lazy_static", @@ -15567,7 +15567,7 @@ dependencies = [ [[package]] name = "tantivy-query-grammar" version = "0.25.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "fnv", "nom 7.1.3", @@ -15579,7 +15579,7 @@ dependencies = [ [[package]] name = "tantivy-sstable" version = "0.6.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "futures-util", "itertools 0.14.0", @@ -15592,7 +15592,7 @@ dependencies = [ [[package]] name = "tantivy-stacker" version = "0.6.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "murmurhash32", "tantivy-common", @@ -15601,7 +15601,7 @@ dependencies = [ [[package]] name = "tantivy-tokenizer-api" version = "0.6.0" -source = "git+https://github.com/datafuse-extras/tantivy?rev=26446bc#26446bc055b33565eefc2d59dce2cf5743261a8b" +source = "git+https://github.com/datafuse-extras/tantivy?rev=b600b0e#b600b0e7df22746cc4beee3a8b9288be16908dbc" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index df34934f73545..38ee6f385d48d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -577,9 +577,9 @@ recursive = { git = "https://github.com/datafuse-extras/recursive.git", rev = "1 sled = { git = "https://github.com/datafuse-extras/sled", tag = "v0.34.7-datafuse.1" } state-machine-api = { git = "https://github.com/databendlabs/state-machine-api.git", tag = "v0.3.4" } sub-cache = { git = "https://github.com/databendlabs/sub-cache", tag = "v0.2.1" } -tantivy = { git = "https://github.com/datafuse-extras/tantivy", rev = "26446bc" } -tantivy-common = { git = "https://github.com/datafuse-extras/tantivy", rev = "26446bc", package = "tantivy-common" } -tantivy-jieba = { git = "https://github.com/datafuse-extras/tantivy-jieba", rev = "18a0ae9" } -tantivy-query-grammar = { git = "https://github.com/datafuse-extras/tantivy", rev = "26446bc", package = "tantivy-query-grammar" } +tantivy = { git = "https://github.com/datafuse-extras/tantivy", rev = "b600b0e" } +tantivy-common = { git = "https://github.com/datafuse-extras/tantivy", rev = "b600b0e", package = "tantivy-common" } +tantivy-jieba = { git = "https://github.com/datafuse-extras/tantivy-jieba", rev = "68ab55c" } +tantivy-query-grammar = { git = "https://github.com/datafuse-extras/tantivy", rev = "b600b0e", package = "tantivy-query-grammar" } watcher = { git = "https://github.com/databendlabs/watcher", tag = "v0.4.2" } xorfilter-rs = { git = "https://github.com/datafuse-extras/xorfilter", tag = "databend-alpha.4" } diff --git a/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test b/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test index fa7cb64534e8d..cb6aaaaa9b692 100644 --- a/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test +++ b/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test @@ -541,6 +541,28 @@ select * from t3 where query('body.videoInfo.extraData.name:codecB AND body.vide ---- 1 {"videoInfo":{"extraData":[{"name":"codecA","type":"mp4"},{"name":"codecB","type":"jpg"}]}} + +statement ok +CREATE TABLE t4 (id int, body variant, INVERTED INDEX idx (body)) + +statement ok +INSERT INTO t4 VALUES +(1, '{"videoInfo":{"extraData":[{ "name": "codecA", "type": "mp4" },{ "name": "codecB", "type": "jpg" }]}}'), +(2, '{"videoInfo":{"extraData":[{ "name": "codecA", "type": "jpg" },{ "name": "codecA", "type": "mp4" }]}}'), +(3, '{"videoInfo":{"extraData":[{ "name": "codecA", "type": "jpg" },{ "name": "codecB", "type": "mp4" }]}}'); + +query IT +select * from t4 where query('body.videoInfo.extraData.name:codecA AND body.videoInfo.extraData.type:jpg'); +---- +2 {"videoInfo":{"extraData":[{"name":"codecA","type":"jpg"},{"name":"codecA","type":"mp4"}]}} +3 {"videoInfo":{"extraData":[{"name":"codecA","type":"jpg"},{"name":"codecB","type":"mp4"}]}} + +query IT +select * from t4 where query('body.videoInfo.extraData.name:codecB AND body.videoInfo.extraData.type:jpg'); +---- +1 {"videoInfo":{"extraData":[{"name":"codecA","type":"mp4"},{"name":"codecB","type":"jpg"}]}} + + statement ok CREATE TABLE t_native (id int, content string, INVERTED INDEX idx1 (content)) storage_format = 'native' row_per_page = 2;