Add ObjectPath query language
Some checks failed
CI / Typos (push) Successful in 19s
CI / Build and test (push) Failing after 40s
CI / Clippy (push) Failing after 53s

This commit is contained in:
2026-03-05 21:35:07 -08:00
parent 0053ed3a69
commit a9e402bc83
11 changed files with 657 additions and 48 deletions

View File

@@ -130,12 +130,7 @@ impl DbFtsIndex {
// Try paths in order, using the first value we find
'outer: for path in field.path.as_slice() {
let segments = path
.split('.')
.map(|x| Label::new(x).unwrap_or_else(|| panic!("wtf {x}")))
.collect::<Vec<_>>();
let val = match extractor.query(&segments)? {
let val = match extractor.query(path)? {
Some(x) => x,
None => return Ok(None),
};
@@ -145,7 +140,7 @@ impl DbFtsIndex {
trace!(
message = "Skipping field, is null",
field = field_name.to_string(),
path,
?path,
// value = ?val
);
continue;
@@ -170,7 +165,7 @@ impl DbFtsIndex {
debug!(
message = "Skipping field, is array with more than one element",
field = field_name.to_string(),
path,
?path,
//value = ?val
);
continue 'outer;
@@ -178,7 +173,7 @@ impl DbFtsIndex {
debug!(
message = "Skipping field, is empty array",
field = field_name.to_string(),
path,
?path,
//value = ?val
);
continue 'outer;
@@ -188,7 +183,7 @@ impl DbFtsIndex {
trace!(
message = "Skipping field, is null",
field = field_name.to_string(),
path,
?path,
//value = ?val
);
continue 'outer;
@@ -197,7 +192,7 @@ impl DbFtsIndex {
trace!(
message = "Skipping field, is object",
field = field_name.to_string(),
path,
?path,
//value = ?val
);
continue 'outer;