mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-04 09:56:28 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/main' into facet-levels-refactor
This commit is contained in:
		@@ -140,7 +140,7 @@ fn fetch_or_generate_document_id(
 | 
			
		||||
                }
 | 
			
		||||
                None => Ok(Err(UserError::MissingDocumentId {
 | 
			
		||||
                    primary_key: primary_key.to_string(),
 | 
			
		||||
                    document: obkv_to_object(&document, &documents_batch_index)?,
 | 
			
		||||
                    document: obkv_to_object(document, documents_batch_index)?,
 | 
			
		||||
                })),
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -156,7 +156,7 @@ fn fetch_or_generate_document_id(
 | 
			
		||||
                        if matching_documents_ids.len() >= 2 {
 | 
			
		||||
                            return Ok(Err(UserError::TooManyDocumentIds {
 | 
			
		||||
                                primary_key: nested.name().to_string(),
 | 
			
		||||
                                document: obkv_to_object(&document, &documents_batch_index)?,
 | 
			
		||||
                                document: obkv_to_object(document, documents_batch_index)?,
 | 
			
		||||
                            }));
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
@@ -170,7 +170,7 @@ fn fetch_or_generate_document_id(
 | 
			
		||||
                },
 | 
			
		||||
                None => Ok(Err(UserError::MissingDocumentId {
 | 
			
		||||
                    primary_key: nested.name().to_string(),
 | 
			
		||||
                    document: obkv_to_object(&document, &documents_batch_index)?,
 | 
			
		||||
                    document: obkv_to_object(document, documents_batch_index)?,
 | 
			
		||||
                })),
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -313,7 +313,7 @@ pub fn validate_document_id_value(document_id: Value) -> Result<StdResult<String
 | 
			
		||||
            None => Ok(Err(UserError::InvalidDocumentId { document_id: Value::String(string) })),
 | 
			
		||||
        },
 | 
			
		||||
        Value::Number(number) if number.is_i64() => Ok(Ok(number.to_string())),
 | 
			
		||||
        content => Ok(Err(UserError::InvalidDocumentId { document_id: content.clone() })),
 | 
			
		||||
        content => Ok(Err(UserError::InvalidDocumentId { document_id: content })),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -132,7 +132,7 @@ fn json_to_string<'a>(value: &'a Value, buffer: &'a mut String) -> Option<&'a st
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if let Value::String(string) = value {
 | 
			
		||||
        Some(&string)
 | 
			
		||||
        Some(string)
 | 
			
		||||
    } else if inner(value, buffer) {
 | 
			
		||||
        Some(buffer)
 | 
			
		||||
    } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ pub fn extract_fid_docid_facet_values<R: io::Read + io::Seek>(
 | 
			
		||||
                facet_exists_docids.entry(field_id).or_default().insert(document);
 | 
			
		||||
 | 
			
		||||
                // For the other extraction tasks, prefix the key with the field_id and the document_id
 | 
			
		||||
                key_buffer.extend_from_slice(&docid_bytes);
 | 
			
		||||
                key_buffer.extend_from_slice(docid_bytes);
 | 
			
		||||
 | 
			
		||||
                let value =
 | 
			
		||||
                    serde_json::from_slice(field_bytes).map_err(InternalError::SerdeJson)?;
 | 
			
		||||
@@ -107,8 +107,8 @@ pub fn extract_fid_docid_facet_values<R: io::Read + io::Seek>(
 | 
			
		||||
    let facet_exists_docids_reader = writer_into_reader(facet_exists_docids_writer)?;
 | 
			
		||||
 | 
			
		||||
    Ok((
 | 
			
		||||
        sorter_into_reader(fid_docid_facet_numbers_sorter, indexer.clone())?,
 | 
			
		||||
        sorter_into_reader(fid_docid_facet_strings_sorter, indexer.clone())?,
 | 
			
		||||
        sorter_into_reader(fid_docid_facet_numbers_sorter, indexer)?,
 | 
			
		||||
        sorter_into_reader(fid_docid_facet_strings_sorter, indexer)?,
 | 
			
		||||
        facet_exists_docids_reader,
 | 
			
		||||
    ))
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -150,7 +150,7 @@ pub(crate) fn data_from_obkv_documents(
 | 
			
		||||
    spawn_extraction_task::<_, _, Vec<grenad::Reader<File>>>(
 | 
			
		||||
        docid_fid_facet_numbers_chunks,
 | 
			
		||||
        indexer,
 | 
			
		||||
        lmdb_writer_sx.clone(),
 | 
			
		||||
        lmdb_writer_sx,
 | 
			
		||||
        extract_facet_number_docids,
 | 
			
		||||
        merge_cbo_roaring_bitmaps,
 | 
			
		||||
        TypedChunk::FieldIdFacetNumberDocids,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user