mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
use distinct on search
This commit is contained in:
parent
72450c765d
commit
a2f0f95337
6 changed files with 44 additions and 9 deletions
|
@ -75,7 +75,7 @@ impl<'c, 'f, 'd> QueryBuilder<'c, 'f, 'd> {
|
|||
self.timeout = Some(timeout)
|
||||
}
|
||||
|
||||
pub fn with_distinct<F, K>(&mut self, function: F, size: usize)
|
||||
pub fn with_distinct<F>(&mut self, size: usize, function: F)
|
||||
where
|
||||
F: Fn(DocumentId) -> Option<u64> + 'd,
|
||||
{
|
||||
|
|
|
@ -254,6 +254,21 @@ impl Index {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn document_attribute_bytes<'txn>(
|
||||
&self,
|
||||
reader: &'txn heed::RoTxn<MainT>,
|
||||
document_id: DocumentId,
|
||||
attribute: FieldId,
|
||||
) -> MResult<Option<&'txn [u8]>> {
|
||||
let bytes = self
|
||||
.documents_fields
|
||||
.document_attribute(reader, document_id, attribute)?;
|
||||
match bytes {
|
||||
Some(bytes) => Ok(Some(bytes)),
|
||||
None => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn customs_update(&self, writer: &mut heed::RwTxn<UpdateT>, customs: Vec<u8>) -> ZResult<u64> {
|
||||
let _ = self.updates_notifier.send(UpdateEvent::NewUpdate);
|
||||
update::push_customs_update(writer, self.updates, self.updates_results, customs)
|
||||
|
|
|
@ -50,9 +50,8 @@ pub fn apply_settings_update(
|
|||
must_reindex = true;
|
||||
},
|
||||
UpdateState::Clear => {
|
||||
let clear: Vec<&str> = Vec::new();
|
||||
schema.update_ranked(clear)?;
|
||||
index.main.delete_ranking_rules(writer)?;
|
||||
schema.clear_ranked();
|
||||
must_reindex = true;
|
||||
},
|
||||
UpdateState::Nothing => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue