Truncate the the normalized long facets used in search for facet value

This commit is contained in:
ManyTheFish 2023-08-08 12:00:51 +02:00
parent e338ceb97f
commit 35758db9ec
3 changed files with 13 additions and 4 deletions

View file

@ -44,7 +44,7 @@ pub fn extract_facet_string_docids<R: io::Read + io::Seek>(
if normalised_value.len() > MAX_FACET_VALUE_LENGTH {
normalised_truncated_value = normalised_value
.char_indices()
.take_while(|(idx, _)| idx + 4 < MAX_FACET_VALUE_LENGTH)
.take_while(|(idx, _)| *idx < MAX_FACET_VALUE_LENGTH)
.map(|(_, c)| c)
.collect();
normalised_value = normalised_truncated_value.as_str();