mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-09 02:22:54 +00:00
Change default index precision to microseconds (#27)
This commit is contained in:
@@ -1441,7 +1441,7 @@ mod test {
|
||||
fn test_json_field_possibly_a_date() {
|
||||
test_parse_query_to_logical_ast_helper(
|
||||
r#"json.date:"2019-10-12T07:20:50.52Z""#,
|
||||
r#"(Term(field=14, type=Json, path=date, type=Date, 2019-10-12T07:20:50Z) "[(0, Term(field=14, type=Json, path=date, type=Str, "2019")), (1, Term(field=14, type=Json, path=date, type=Str, "10")), (2, Term(field=14, type=Json, path=date, type=Str, "12t07")), (3, Term(field=14, type=Json, path=date, type=Str, "20")), (4, Term(field=14, type=Json, path=date, type=Str, "50")), (5, Term(field=14, type=Json, path=date, type=Str, "52z"))]")"#,
|
||||
r#"(Term(field=14, type=Json, path=date, type=Date, 2019-10-12T07:20:50.52Z) "[(0, Term(field=14, type=Json, path=date, type=Str, "2019")), (1, Term(field=14, type=Json, path=date, type=Str, "10")), (2, Term(field=14, type=Json, path=date, type=Str, "12t07")), (3, Term(field=14, type=Json, path=date, type=Str, "20")), (4, Term(field=14, type=Json, path=date, type=Str, "50")), (5, Term(field=14, type=Json, path=date, type=Str, "52z"))]")"#,
|
||||
true,
|
||||
);
|
||||
}
|
||||
@@ -1734,7 +1734,7 @@ mod test {
|
||||
);
|
||||
test_parse_query_to_logical_ast_helper(
|
||||
r#"date:"1985-04-12T23:20:50.52Z""#,
|
||||
r#"Term(field=9, type=Date, 1985-04-12T23:20:50Z)"#,
|
||||
r#"Term(field=9, type=Date, 1985-04-12T23:20:50.52Z)"#,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
|
||||
use crate::schema::flags::{FastFlag, IndexedFlag, SchemaFlagList, StoredFlag};
|
||||
|
||||
/// The precision of the indexed date/time values in the inverted index.
|
||||
pub const DATE_TIME_PRECISION_INDEXED: DateTimePrecision = DateTimePrecision::Seconds;
|
||||
pub const DATE_TIME_PRECISION_INDEXED: DateTimePrecision = DateTimePrecision::Microseconds;
|
||||
|
||||
/// Defines how DateTime field should be handled by tantivy.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
|
||||
Reference in New Issue
Block a user