mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
fix distinct attribute behavior
This commit is contained in:
parent
60a90e96f3
commit
8035ca7138
4 changed files with 22 additions and 19 deletions
|
@ -89,10 +89,14 @@ async fn get_all(
|
|||
.map(|r| r.to_string())
|
||||
.collect();
|
||||
|
||||
let distinct_attribute = index.main.distinct_attribute(&reader)?;
|
||||
|
||||
let schema = index.main.schema(&reader)?;
|
||||
|
||||
let distinct_attribute = match (index.main.distinct_attribute(&reader)?, &schema) {
|
||||
(Some(id), Some(schema)) => schema.name(id).map(str::to_string),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
let attributes_for_faceting = match (&schema, &index.main.attributes_for_faceting(&reader)?) {
|
||||
(Some(schema), Some(attrs)) => {
|
||||
attrs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue