mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-03-13 20:31:17 +08:00
fet: Move meilidb example into the meilidb workspace
This commit is contained in:
parent
9dcc6e90c9
commit
bb86997af2
@ -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;
|
@ -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 {
|
Loading…
x
Reference in New Issue
Block a user