diff --git a/core/formats/formats_burst_trie.cpp b/core/formats/formats_burst_trie.cpp index 644537ac3..8fc19c1ff 100644 --- a/core/formats/formats_burst_trie.cpp +++ b/core/formats/formats_burst_trie.cpp @@ -3208,7 +3208,8 @@ class field_reader final : public irs::field_reader { size_t read_documents(bytes_view term, std::span docs) const final { - if (IRS_UNLIKELY(docs.empty())) { + // Order is important here! + if (max() < term || term < min() || docs.empty()) { return 0; }