From 397522f277aab19ebc6de859379880c214b78486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 26 Feb 2019 13:50:46 +0100 Subject: [PATCH] fet: Move meilidb example into the meilidb workspace --- examples/ebay/schema-example.toml | 19 ------------------- .../examples}/create-database.rs | 4 +--- .../examples}/query-database.rs | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 examples/ebay/schema-example.toml rename {examples => meilidb/examples}/create-database.rs (95%) rename {examples => meilidb/examples}/query-database.rs (99%) diff --git a/examples/ebay/schema-example.toml b/examples/ebay/schema-example.toml deleted file mode 100644 index fcf2685e9..000000000 --- a/examples/ebay/schema-example.toml +++ /dev/null @@ -1,19 +0,0 @@ -# This schema has been generated ... -# The order in which the attributes are declared is important, -# it specify the attribute xxx... - -identifier = "id" - -[attributes.id] -stored = true - -[attributes.title] -stored = true -indexed = true - -[attributes.description] -stored = true -indexed = true - -[attributes.image] -stored = true diff --git a/examples/create-database.rs b/meilidb/examples/create-database.rs similarity index 95% rename from examples/create-database.rs rename to meilidb/examples/create-database.rs index 37e252e1a..e5d9c403a 100644 --- a/examples/create-database.rs +++ b/meilidb/examples/create-database.rs @@ -13,7 +13,6 @@ use serde_derive::{Serialize, Deserialize}; use structopt::StructOpt; use meilidb::database::{Database, Schema}; -use meilidb::tokenizer::DefaultBuilder; #[derive(Debug, StructOpt)] pub struct Opt { @@ -63,7 +62,6 @@ fn index( let mut end_of_file = false; while !end_of_file { - let tokenizer_builder = DefaultBuilder::new(); let mut update = database.start_update("default")?; loop { @@ -78,7 +76,7 @@ fn index( } }; - update.update_document(&document, &tokenizer_builder, &stop_words)?; + update.update_document(&document, &stop_words)?; print!("\rindexing document {}", i); i += 1; diff --git a/examples/query-database.rs b/meilidb/examples/query-database.rs similarity index 99% rename from examples/query-database.rs rename to meilidb/examples/query-database.rs index ca6733c30..2689ffe0f 100644 --- a/examples/query-database.rs +++ b/meilidb/examples/query-database.rs @@ -11,10 +11,10 @@ use std::error::Error; use hashbrown::{HashMap, HashSet}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; use structopt::StructOpt; +use meilidb_core::Match; use meilidb::database::schema::SchemaAttr; use meilidb::database::Database; -use meilidb::Match; #[derive(Debug, StructOpt)] pub struct Opt {