mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-25 19:49:57 +00:00
add range query handling for ip via term dictionary
since IPs are mapped monotonically we can use the term dictionary for range queries
This commit is contained in:
@@ -404,9 +404,10 @@ impl QueryParser {
|
||||
let bytes = base64::decode(phrase).map_err(QueryParserError::ExpectedBase64)?;
|
||||
Ok(Term::from_field_bytes(field, &bytes))
|
||||
}
|
||||
FieldType::IpAddr(_) => Err(QueryParserError::UnsupportedQuery(
|
||||
"Range query are not supported on ip field.".to_string(),
|
||||
)),
|
||||
FieldType::IpAddr(_) => {
|
||||
let ip_v6 = IpAddr::from_str(phrase)?.into_ipv6_addr();
|
||||
Ok(Term::from_field_ip_addr(field, ip_v6))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user