fet: Move meilidb example into the meilidb workspace

This commit is contained in:
Clément Renault 2019-02-26 13:50:46 +01:00
parent a745819ddf
commit 397522f277
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE
3 changed files with 2 additions and 23 deletions

View File

@ -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

View File

@ -13,7 +13,6 @@ use serde_derive::{Serialize, Deserialize};
use structopt::StructOpt; use structopt::StructOpt;
use meilidb::database::{Database, Schema}; use meilidb::database::{Database, Schema};
use meilidb::tokenizer::DefaultBuilder;
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]
pub struct Opt { pub struct Opt {
@ -63,7 +62,6 @@ fn index(
let mut end_of_file = false; let mut end_of_file = false;
while !end_of_file { while !end_of_file {
let tokenizer_builder = DefaultBuilder::new();
let mut update = database.start_update("default")?; let mut update = database.start_update("default")?;
loop { 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); print!("\rindexing document {}", i);
i += 1; i += 1;

View File

@ -11,10 +11,10 @@ use std::error::Error;
use hashbrown::{HashMap, HashSet}; use hashbrown::{HashMap, HashSet};
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
use structopt::StructOpt; use structopt::StructOpt;
use meilidb_core::Match;
use meilidb::database::schema::SchemaAttr; use meilidb::database::schema::SchemaAttr;
use meilidb::database::Database; use meilidb::database::Database;
use meilidb::Match;
#[derive(Debug, StructOpt)] #[derive(Debug, StructOpt)]
pub struct Opt { pub struct Opt {