diff --git a/Cargo.lock b/Cargo.lock index 91352e30fcad..3b3022e51316 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3385,7 +3385,7 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oneshot" version = "0.1.6" -source = "git+https://github.com/fulmicoton/oneshot.git?rev=c10a3ba#c10a3ba32adc189acf68acd579ba9755075ecb4d" +source = "git+https://github.com/fulmicoton/oneshot.git?rev=b208f49#b208f493e505f5f37e180b5cdec4c22b6f99abaa" dependencies = [ "loom", ] @@ -3496,7 +3496,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "ownedbytes" version = "0.7.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "stable_deref_trait", ] @@ -5615,7 +5615,7 @@ dependencies = [ [[package]] name = "tantivy" version = "0.23.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "aho-corasick", "arc-swap", @@ -5664,7 +5664,7 @@ dependencies = [ [[package]] name = "tantivy-bitpacker" version = "0.6.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "bitpacking", ] @@ -5672,7 +5672,7 @@ dependencies = [ [[package]] name = "tantivy-columnar" version = "0.3.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "downcast-rs", "fastdivide", @@ -5687,7 +5687,7 @@ dependencies = [ [[package]] name = "tantivy-common" version = "0.7.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "async-trait", "byteorder", @@ -5710,7 +5710,7 @@ dependencies = [ [[package]] name = "tantivy-query-grammar" version = "0.22.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "nom", ] @@ -5718,7 +5718,7 @@ dependencies = [ [[package]] name = "tantivy-sstable" version = "0.3.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "tantivy-bitpacker", "tantivy-common", @@ -5729,7 +5729,7 @@ dependencies = [ [[package]] name = "tantivy-stacker" version = "0.3.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "murmurhash32", "rand_distr", @@ -5739,7 +5739,7 @@ dependencies = [ [[package]] name = "tantivy-tokenizer-api" version = "0.3.0" -source = "git+https://github.com/quickwit-oss/tantivy?rev=b806122#b806122c817f19598c85369fe5c6e6788f81139d" +source = "git+https://github.com/wsxiaoys/tantivy?rev=442a7b3#442a7b389e04caf1d692b1d04f602f49f17f8919" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 76d7581ad13d..1f7cdc85cdf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ tracing = "0.1" tokio-cron-scheduler = "0.9.4" tracing-subscriber = "0.3" anyhow = "1.0.71" -tantivy = { git = "https://github.com/quickwit-oss/tantivy", rev = "b806122" } +tantivy = { git = "https://github.com/wsxiaoys/tantivy", rev = "442a7b3" } async-trait = "0.1.72" reqwest = { version = "0.12" } derive_builder = "0.12.0" diff --git a/crates/tabby/src/services/code.rs b/crates/tabby/src/services/code.rs index 1733252375cc..1134d84fdd12 100644 --- a/crates/tabby/src/services/code.rs +++ b/crates/tabby/src/services/code.rs @@ -14,7 +14,7 @@ use tabby_common::{ }; use tantivy::{ collector::{Count, TopDocs}, - schema::{self, document::ReferenceValue, Value}, + schema::{self, Value}, IndexReader, TantivyDocument, }; use tokio::sync::Mutex; @@ -125,10 +125,10 @@ fn get_text(doc: &TantivyDocument, field: schema::Field) -> &str { } fn get_json_number_field(doc: &TantivyDocument, field: schema::Field, name: &str) -> i64 { - let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else { - panic!("Field {} is not an object", name); - }; - obj.into_iter() + doc.get_first(field) + .unwrap() + .as_object() + .unwrap() .find(|(k, _)| *k == name) .unwrap() .1 @@ -137,10 +137,10 @@ fn get_json_number_field(doc: &TantivyDocument, field: schema::Field, name: &str } fn get_json_text_field<'a>(doc: &'a TantivyDocument, field: schema::Field, name: &str) -> &'a str { - let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else { - panic!("Field {} is not an object", name); - }; - obj.into_iter() + doc.get_first(field) + .unwrap() + .as_object() + .unwrap() .find(|(k, _)| *k == name) .unwrap() .1 diff --git a/crates/tabby/src/services/doc/tantivy.rs b/crates/tabby/src/services/doc/tantivy.rs index c93b8283d01a..4eea1b8893d4 100644 --- a/crates/tabby/src/services/doc/tantivy.rs +++ b/crates/tabby/src/services/doc/tantivy.rs @@ -9,7 +9,7 @@ use tabby_common::{ use tabby_inference::Embedding; use tantivy::{ collector::TopDocs, - schema::{self, document::ReferenceValue, Value}, + schema::{self, Value}, IndexReader, TantivyDocument, }; use tracing::warn; @@ -87,10 +87,10 @@ fn get_text(doc: &TantivyDocument, field: schema::Field) -> &str { } fn get_json_text_field<'a>(doc: &'a TantivyDocument, field: schema::Field, name: &str) -> &'a str { - let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else { - panic!("Field {} is not an object", name); - }; - obj.into_iter() + doc.get_first(field) + .unwrap() + .as_object() + .unwrap() .find(|(k, _)| *k == name) .unwrap() .1