fix duplicates search

This commit is contained in:
Damien Elmes 2020-04-04 17:37:22 +10:00
parent 7375a0389a
commit 0750ad5c62
2 changed files with 4 additions and 4 deletions

View file

@ -273,7 +273,7 @@ fn search_node_for_text_with_argument<'a>(
"is" => parse_state(val.as_ref())?,
"flag" => parse_flag(val.as_ref())?,
"rated" => parse_rated(val.as_ref())?,
"dupes" => parse_dupes(val.as_ref())?,
"dupe" => parse_dupes(val.as_ref())?,
"prop" => parse_prop(val.as_ref())?,
"re" => SearchNode::Regex(val),
"nc" => SearchNode::NoCombining(val),

View file

@ -358,7 +358,7 @@ impl SqlWriter<'_> {
let csum = field_checksum(text_nohtml.as_ref());
write!(
self.sql,
"(n.mid = {} and n.csum = {} and field_at_index(n.flds, 0) = ?",
"(n.mid = {} and n.csum = {} and field_at_index(n.flds, 0) = ?)",
ntid, csum
)
.unwrap();
@ -557,9 +557,9 @@ mod test {
// dupes
assert_eq!(
s(ctx, "dupes:123,test"),
s(ctx, "dupe:123,test"),
(
"((n.mid = 123 and n.csum = 2840236005 and field_at_index(n.flds, 0) = ?)".into(),
"((n.mid = 123 and n.csum = 2840236005 and field_at_index(n.flds, 0) = ?))".into(),
vec!["test".into()]
)
);