diff --git a/crates/tabby-common/src/index.rs b/crates/tabby-common/src/index.rs index eec2549..14926f8 100644 --- a/crates/tabby-common/src/index.rs +++ b/crates/tabby-common/src/index.rs @@ -5,8 +5,8 @@ use tantivy::{ Index, Term, }; -pub static CODE_TOKENIZER: &str = "code"; -pub static IDENTIFIER_TOKENIZER: &str = "identifier"; +static CODE_TOKENIZER: &str = "code"; +static IDENTIFIER_TOKENIZER: &str = "identifier"; pub fn register_tokenizers(index: &Index) { let code_tokenizer = TextAnalyzer::builder(RegexTokenizer::new(r"(?:\w+)").unwrap()) @@ -71,6 +71,12 @@ impl CodeSearchSchema { } } +impl Default for CodeSearchSchema { + fn default() -> Self { + Self::new() + } +} + impl CodeSearchSchema { pub fn language_query(&self, language: &str) -> Box { Box::new(TermQuery::new(