group montonic mapping and inverse

fix mapping inverse
remove ip indexing
add get_between_vals test
This commit is contained in:
Pascal Seitz
2022-10-04 16:53:03 +08:00
parent 67f453b534
commit cdc8e3a8be
7 changed files with 130 additions and 53 deletions

View File

@@ -319,7 +319,7 @@ impl MultiValueU128FastFieldWriter {
let value = field_value.value();
let ip_addr = value
.as_ip()
.expect(&format!("expected and ip, but got {:?}", value));
.unwrap_or_else(|| panic!("expected and ip, but got {:?}", value));
let value = ip_addr.to_u128();
self.add_val(value);
}

View File

@@ -331,7 +331,7 @@ impl U128FastFieldWriter {
Some(v) => {
let ip_addr = v
.as_ip()
.expect(&format!("expected and ip, but got {:?}", v));
.unwrap_or_else(|| panic!("expected and ip, but got {:?}", v));
let value = ip_addr.to_u128();
self.add_val(value);

View File

@@ -294,13 +294,7 @@ impl SegmentWriter {
ctx,
)?;
}
FieldType::IpAddr(_) => {
for value in values {
let ip_val = value.as_ip().ok_or_else(make_schema_error)?;
term_buffer.set_text(&ip_val.to_string());
postings_writer.subscribe(doc_id, 0u32, term_buffer, ctx);
}
}
FieldType::IpAddr(_) => {}
}
}
Ok(())