Skip to content

Commit

Permalink
Revert "Emulate sqlite FTS"
Browse files Browse the repository at this point in the history
This reverts commit 2820c4b.
  • Loading branch information
sanketkedia committed Jun 17, 2024
1 parent 2820c4b commit 011c28a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions chromadb/segment/impl/metadata/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ def _where_doc_criterion(
elif k == "$contains":
v = cast(str, v)
search_term = f"%{v}%"

sq = (
self._db.querybuilder()
.from_(fulltext_t)
Expand Down
1 change: 0 additions & 1 deletion rust/worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
opentelemetry = { version = "0.19.0", default-features = false, features = ["trace", "rt-tokio"] }
opentelemetry-otlp = "0.12.0"
shuttle = "0.7.1"
regex = "1.10.5"


[dev-dependencies]
Expand Down
6 changes: 1 addition & 5 deletions rust/worker/src/execution/operators/metadata_filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::{
};
use core::panic;
use futures::stream::Count;
use regex::Regex;
use roaring::RoaringBitmap;
use std::{
collections::{HashMap, HashSet},
Expand Down Expand Up @@ -523,10 +522,7 @@ impl Operator<MetadataFilteringInput, MetadataFilteringOutput> for MetadataFilte
}
match record.merged_document_ref() {
Some(doc) => {
// Replace all occurences of _ and % with . in query.
let normalized_query = query.replace("_", ".").replace("%", ".");
let re = Regex::new(normalized_query.as_str()).unwrap();
if re.is_match(doc) {
if doc.contains(query) {
matching_contains.push(record.offset_id as i32);
}
}
Expand Down

0 comments on commit 011c28a

Please sign in to comment.