mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
Make the example return documents field in a consistent order
This commit is contained in:
parent
bb35ca0d40
commit
663714bb6d
@ -47,6 +47,7 @@ branch = "arc-byte-slice"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_matches = "1.3"
|
assert_matches = "1.3"
|
||||||
csv = "1.0.7"
|
csv = "1.0.7"
|
||||||
|
indexmap = { version = "1.2.0", features = ["serde-1"] }
|
||||||
rustyline = { version = "5.0.0", default-features = false }
|
rustyline = { version = "5.0.0", default-features = false }
|
||||||
structopt = "0.3.2"
|
structopt = "0.3.2"
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use std::collections::btree_map::{BTreeMap, Entry};
|
use std::collections::btree_map::{BTreeMap, Entry};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::HashSet;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::iter::FromIterator;
|
use std::iter::FromIterator;
|
||||||
@ -74,7 +74,7 @@ impl Command {
|
|||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
struct Document(HashMap<String, String>);
|
struct Document(indexmap::IndexMap<String, String>);
|
||||||
|
|
||||||
fn index_command(command: IndexCommand, database: Database) -> Result<(), Box<dyn Error>> {
|
fn index_command(command: IndexCommand, database: Database) -> Result<(), Box<dyn Error>> {
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
@ -316,7 +316,7 @@ fn search_command(command: SearchCommand, database: Database) -> Result<(), Box<
|
|||||||
println!();
|
println!();
|
||||||
}
|
}
|
||||||
|
|
||||||
eprintln!("document field retrieve took {:.2?}", retrieve_duration);
|
eprintln!("whole documents fields retrieve took {:.2?}", retrieve_duration);
|
||||||
eprintln!("===== Found {} results in {:.2?} =====", number_of_documents, start_total.elapsed());
|
eprintln!("===== Found {} results in {:.2?} =====", number_of_documents, start_total.elapsed());
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user