changed the implementation of displayedAttributes from HashSet into BtreeSet

This commit is contained in:
gorogoroumaru 2020-09-02 11:13:16 +09:00
parent c94daf8c3d
commit e47b4acd08
2 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ use actix_web::{web, HttpResponse};
use actix_web_macros::{delete, get, post};
use meilisearch_core::settings::{Settings, SettingsUpdate, UpdateState, DEFAULT_RANKING_RULES};
use meilisearch_schema::Schema;
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::collections::{BTreeMap, BTreeSet};
use crate::error::{Error, ResponseError};
use crate::helpers::Authentication;
@ -390,7 +390,7 @@ async fn get_displayed(
async fn update_displayed(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<HashSet<String>>>,
body: web::Json<Option<BTreeSet<String>>>,
) -> Result<HttpResponse, ResponseError> {
let index = data
.db
@ -524,7 +524,7 @@ fn get_indexed_attributes(schema: &Schema) -> Vec<String> {
}
}
fn get_displayed_attributes(schema: &Schema) -> HashSet<String> {
fn get_displayed_attributes(schema: &Schema) -> BTreeSet<String> {
if schema.is_displayed_all() {
["*"].iter().map(|s| s.to_string()).collect()
} else {