return CompactDocValue instead of trait (#2410)

The CompactDocValue is easier to handle than the trait in some cases like comparison
and conversion
This commit is contained in:
PSeitz
2024-05-27 07:33:50 +02:00
committed by GitHub
parent b806122c81
commit 2e3641c2ae
10 changed files with 137 additions and 91 deletions

View File

@@ -4,7 +4,7 @@
use tantivy::collector::TopDocs;
use tantivy::query::QueryParser;
use tantivy::schema::{DateOptions, Document, Schema, INDEXED, STORED, STRING};
use tantivy::schema::{DateOptions, Document, Schema, Value, INDEXED, STORED, STRING};
use tantivy::{Index, IndexWriter, TantivyDocument};
fn main() -> tantivy::Result<()> {
@@ -64,6 +64,7 @@ fn main() -> tantivy::Result<()> {
assert!(retrieved_doc
.get_first(occurred_at)
.unwrap()
.as_value()
.as_datetime()
.is_some(),);
assert_eq!(