I might be wrong and it might just be about countb (which behaves surprinsingly), but flusho seems to not remove orphan terms from the index. Maybe it was just not designed for it, but I don’t remember reading about this.
#[test]
fn flusho() {
let ctx = start_empty(|command| command);
let multiplexer = SonicMultiplexer::new().unwrap();
let ingest =
SonicChannelIngestBlocking::connect(ctx.addr, "SecretPassword", &multiplexer).unwrap();
let control =
SonicChannelControlBlocking::connect(ctx.addr, "SecretPassword", &multiplexer).unwrap();
ingest
.push("collection", "bucket", "object:1", "foo bar baz")
.unwrap();
ingest
.push("collection", "bucket", "object:2", "foo aaa")
.unwrap();
control.trigger_consolidate().unwrap();
let res = ingest.countb("collection", "bucket").unwrap();
assert_eq!(res, 4);
let res = ingest.flusho("collection", "bucket", "object:1").unwrap();
assert_eq!(res, 3);
control.trigger_consolidate().unwrap();
let res = ingest.countb("collection", "bucket").unwrap();
assert_eq!(res, 2); // assertion `left == right` failed (left: 4, right: 2)
}
I might be wrong and it might just be about
countb(which behaves surprinsingly), butflushoseems to not remove orphan terms from the index. Maybe it was just not designed for it, but I don’t remember reading about this.