mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
fet: Move meilidb example into the meilidb workspace
This commit is contained in:
parent
a745819ddf
commit
397522f277
@ -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
|
|
@ -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…
Reference in New Issue
Block a user