query: add created/timestamp sort fields
Make 'created' resolve to created_at epoch (numeric, sortable) and add 'timestamp' field. Enables `sort created desc` and `sort created asc` in query pipelines. Example: poc-memory query "key ~ 'bcachefs' | sort created desc | limit 10" Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
83342897c8
commit
502bf5410c
1 changed files with 2 additions and 1 deletions
|
|
@ -180,7 +180,8 @@ fn resolve_field(field: &str, key: &str, store: &Store, graph: &Graph) -> Option
|
|||
"retrievals" => Some(Value::Num(node.retrievals as f64)),
|
||||
"uses" => Some(Value::Num(node.uses as f64)),
|
||||
"wrongs" => Some(Value::Num(node.wrongs as f64)),
|
||||
"created" => Some(Value::Str(node.created.clone())),
|
||||
"created" => Some(Value::Num(node.created_at as f64)),
|
||||
"timestamp" => Some(Value::Num(node.timestamp as f64)),
|
||||
"content" => Some(Value::Str(node.content.clone())),
|
||||
"degree" => Some(Value::Num(graph.degree(key) as f64)),
|
||||
"community_id" => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue