Add ObjectPath query language
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user