Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions quickwit/quickwit-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ documentation = "https://quickwit.io/docs/"
anyhow = { workspace = true }
colored = { workspace = true }
env_logger = { workspace = true }
fastfield_codecs = { workspace = true }
home = { workspace = true }
itertools = { workspace = true }
num_cpus = { workspace = true }
Expand All @@ -23,7 +22,6 @@ prometheus = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
tantivy = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion quickwit/quickwit-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
mod checklist;
mod coolid;

pub mod fast_field_reader;
pub mod fs;
pub mod metrics;
pub mod net;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

use std::sync::Arc;

use tantivy::fastfield::{Column, FastFieldReaders};
use tantivy::schema::{Field, FieldEntry, Type};
use tantivy::{DateTime, DocId, TantivyError};
use tantivy::fastfield::Column;
use tantivy::schema::{Field, Type};
use tantivy::{DateTime, DocId, SegmentReader, TantivyError};

#[derive(Clone)]
pub enum GenericFastFieldReader {
Expand Down Expand Up @@ -60,9 +60,11 @@ impl GenericFastFieldReader {

pub fn timestamp_field_reader(
timestamp_field: Field,
timestamp_field_entry: &FieldEntry,
fast_field_readers: &FastFieldReaders,
segment_reader: &SegmentReader,
) -> tantivy::Result<GenericFastFieldReader> {
let schema = segment_reader.schema();
let timestamp_field_entry = schema.get_field_entry(timestamp_field);
let fast_field_readers = segment_reader.fast_fields();
let field_schema_type = timestamp_field_entry.field_type().value_type();
let timestamp_field_reader = match field_schema_type {
Type::I64 => GenericFastFieldReader::I64(fast_field_readers.i64(timestamp_field)?),
Expand Down
3 changes: 3 additions & 0 deletions quickwit/quickwit-doc-mapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
mod default_doc_mapper;
mod doc_mapper;
mod error;

#[allow(missing_docs)]
pub mod fast_field_reader;
mod query_builder;
mod routing_expression;
mod sort_by;
Expand Down
13 changes: 3 additions & 10 deletions quickwit/quickwit-indexing/src/actors/merge_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ use async_trait::async_trait;
use fail::fail_point;
use itertools::Itertools;
use quickwit_actors::{Actor, ActorContext, ActorExitStatus, Handler, Mailbox, QueueCapacity};
use quickwit_common::fast_field_reader::timestamp_field_reader;
use quickwit_common::runtimes::RuntimeType;
use quickwit_directories::UnionDirectory;
use quickwit_doc_mapper::fast_field_reader::timestamp_field_reader;
use quickwit_doc_mapper::{DocMapper, QUICKWIT_TOKENIZER_MANAGER};
use quickwit_metastore::{Metastore, SplitMetadata};
use quickwit_proto::metastore_api::DeleteTask;
Expand Down Expand Up @@ -452,15 +452,8 @@ impl MergeExecutor {
timestamp_field_name
))
})?;
let timestamp_field_entry = merged_segment_reader
.schema()
.get_field_entry(timestamp_field);
let reader = timestamp_field_reader(
timestamp_field,
timestamp_field_entry,
merged_segment_reader.fast_fields(),
)?;
Some(RangeInclusive::new(reader.min_value(), reader.max_value()))
let reader = timestamp_field_reader(timestamp_field, &merged_segment_reader)?;
Some(reader.min_value()..=reader.max_value())
} else {
None
};
Expand Down
11 changes: 2 additions & 9 deletions quickwit/quickwit-search/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use std::ops::{Bound, RangeBounds};

use quickwit_common::fast_field_reader::{timestamp_field_reader, GenericFastFieldReader};
use quickwit_doc_mapper::fast_field_reader::{timestamp_field_reader, GenericFastFieldReader};
use tantivy::schema::Field;
use tantivy::{DocId, SegmentReader};

Expand Down Expand Up @@ -71,14 +71,7 @@ impl TimestampFilterBuilder {
&self,
segment_reader: &SegmentReader,
) -> tantivy::Result<Option<TimestampFilter>> {
let timestamp_field_entry = segment_reader
.schema()
.get_field_entry(self.timestamp_field);
let timestamp_field_reader = timestamp_field_reader(
self.timestamp_field,
timestamp_field_entry,
segment_reader.fast_fields(),
)?;
let timestamp_field_reader = timestamp_field_reader(self.timestamp_field, segment_reader)?;
let segment_range = (
timestamp_field_reader.min_value(),
timestamp_field_reader.max_value(),
Expand Down