Skip to content

Commit 6bdfe4e

Browse files
authored
Always store the termdict indices in the hotcache. (#1384)
Before it could be skipped if it was greater than 10mb, but Quickwit does not work at all if it not there. Such size was uncommon and due to a misconfiguration. We are mitigating the size problem independently. Closes #1366
1 parent b777ac3 commit 6bdfe4e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

quickwit-directories/src/hot_directory.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,17 @@ pub fn write_hotcache<D: Directory>(
506506
if let Some(intervals) = per_file_slices.get(&file_path) {
507507
for byte_range in intervals {
508508
let len = byte_range.len();
509-
if file_path.to_string_lossy().ends_with("store") || len < 10_000_000 {
509+
// We do not want to store slices that are too large in the hotcache,
510+
// but on the other hand, the term dictionray index and the docstore
511+
// index are required for quickwit to work.
512+
//
513+
// Warning: we need to work on string here because `Path::ends_with`
514+
// has very different semantics.
515+
let file_path_str = file_path.to_string_lossy();
516+
if file_path_str.ends_with("store")
517+
|| file_path_str.ends_with("term")
518+
|| len < 10_000_000
519+
{
510520
let bytes = file_slice.read_bytes_slice(byte_range.clone())?;
511521
file_cache_builder.add_bytes(bytes.as_slice(), byte_range.start);
512522
}

0 commit comments

Comments
 (0)