make it easier to negate a search term

This commit is contained in:
Damien Elmes 2021-02-11 10:35:52 +10:00
parent 67d612926c
commit 843ec29228
2 changed files with 2 additions and 0 deletions

View file

@ -824,6 +824,7 @@ message SearchTerm {
CardState card_state = 12;
IdList nids = 13;
uint32 edited_in_days = 14;
SearchTerm negated = 15;
}
}

View file

@ -354,6 +354,7 @@ impl From<pb::SearchTerm> for Node<'_> {
Flag::Green => Node::Search(SearchNode::Flag(3)),
Flag::Blue => Node::Search(SearchNode::Flag(4)),
},
Filter::Negated(term) => Node::Not(Box::new((*term).into())),
}
} else {
Node::Search(SearchNode::WholeCollection)