diff --git a/src/fastfield/multivalued/writer.rs b/src/fastfield/multivalued/writer.rs index eb42c4386..8cc0fc49d 100644 --- a/src/fastfield/multivalued/writer.rs +++ b/src/fastfield/multivalued/writer.rs @@ -143,7 +143,7 @@ impl MultiValueIntFastFieldWriter { .iter() .map(|val| *mapping.get(val).expect("Missing term ordinal")); doc_vals.extend(remapped_vals); - doc_vals.sort(); + doc_vals.sort_unstable(); for &val in &doc_vals { value_serializer.add_val(val)?; } diff --git a/src/indexer/segment_updater.rs b/src/indexer/segment_updater.rs index 159aee91c..a346e8fc4 100644 --- a/src/indexer/segment_updater.rs +++ b/src/indexer/segment_updater.rs @@ -450,9 +450,8 @@ impl SegmentUpdater { .into_iter() .map(|merge_candidate: MergeCandidate| { MergeOperation::new(&self.merge_operations, commit_opstamp, merge_candidate.0) - }) - .collect::>(); - merge_candidates.extend(committed_merge_candidates.into_iter()); + }); + merge_candidates.extend(committed_merge_candidates); for merge_operation in merge_candidates { if let Err(err) = self.start_merge(merge_operation) { diff --git a/src/schema/value.rs b/src/schema/value.rs index f695d0554..fa8f43fb0 100644 --- a/src/schema/value.rs +++ b/src/schema/value.rs @@ -7,7 +7,7 @@ use std::{cmp::Ordering, fmt}; /// Value represents the value of a any field. /// It is an enum over all over all of the possible field type. -#[derive(Debug, Clone, PartialEq, PartialOrd)] +#[derive(Debug, Clone, PartialEq)] pub enum Value { /// The str type is used for any text information. Str(String), @@ -28,6 +28,11 @@ pub enum Value { } impl Eq for Value {} +impl PartialOrd for Value { + fn partial_cmp(&self, other: &Value) -> Option { + Some(self.cmp(other)) + } +} impl Ord for Value { fn cmp(&self, other: &Self) -> Ordering { match (self, other) {