mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
feat: Introduce the new Index structure
replacing the old ugly Blob system
This commit is contained in:
parent
6bd779f9ae
commit
0080bf486f
28 changed files with 481 additions and 1712 deletions
|
@ -5,7 +5,7 @@ use serde_derive::{Serialize, Deserialize};
|
|||
use structopt::StructOpt;
|
||||
|
||||
use meilidb::database::schema::{Schema, SchemaBuilder, STORED, INDEXED};
|
||||
use meilidb::database::PositiveUpdateBuilder;
|
||||
use meilidb::database::UpdateBuilder;
|
||||
use meilidb::tokenizer::DefaultBuilder;
|
||||
use meilidb::database::Database;
|
||||
|
||||
|
@ -44,7 +44,7 @@ fn index(schema: Schema, database_path: &Path, csv_data_path: &Path) -> Result<D
|
|||
|
||||
let tokenizer_builder = DefaultBuilder::new();
|
||||
let update_path = tempfile::NamedTempFile::new()?;
|
||||
let mut update = PositiveUpdateBuilder::new(update_path.path(), schema, tokenizer_builder);
|
||||
let mut update = UpdateBuilder::new(update_path.path().to_path_buf(), schema);
|
||||
|
||||
let mut rdr = csv::Reader::from_path(csv_data_path)?;
|
||||
let mut raw_record = csv::StringRecord::new();
|
||||
|
@ -59,12 +59,10 @@ fn index(schema: Schema, database_path: &Path, csv_data_path: &Path) -> Result<D
|
|||
}
|
||||
};
|
||||
|
||||
update.update(&document).unwrap();
|
||||
update.update_document(&document).unwrap();
|
||||
}
|
||||
|
||||
let mut update = update.build()?;
|
||||
|
||||
update.set_move(true);
|
||||
database.ingest_update_file(update)?;
|
||||
|
||||
Ok(database)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue