remove update_id in UpdateBuilder

This commit is contained in:
Marin Postma
2021-11-03 13:12:01 +01:00
parent 21b78f3926
commit 6eb47ab792
17 changed files with 217 additions and 256 deletions

View File

@ -84,19 +84,19 @@ mod test {
let mut txn = index.write_txn().unwrap();
// set distinct and faceted attributes for the index.
let builder = UpdateBuilder::new(0);
let builder = UpdateBuilder::new();
let mut update = builder.settings(&mut txn, &index);
update.set_distinct_field(distinct.to_string());
update.execute(|_, _| ()).unwrap();
update.execute(|_| ()).unwrap();
// add documents to the index
let builder = UpdateBuilder::new(1);
let builder = UpdateBuilder::new();
let mut addition = builder.index_documents(&mut txn, &index);
addition.index_documents_method(IndexDocumentsMethod::ReplaceDocuments);
let reader =
crate::documents::DocumentBatchReader::from_reader(Cursor::new(&*JSON)).unwrap();
addition.execute(reader, |_, _| ()).unwrap();
addition.execute(reader, |_| ()).unwrap();
let fields_map = index.fields_ids_map(&txn).unwrap();
let fid = fields_map.id(&distinct).unwrap();

View File

@ -512,10 +512,10 @@ mod tests {
// Set the filterable fields to be the channel.
let mut wtxn = index.write_txn().unwrap();
let mut builder = Settings::new(&mut wtxn, &index, 0);
let mut builder = Settings::new(&mut wtxn, &index);
builder.set_searchable_fields(vec![S("title")]);
builder.set_filterable_fields(hashset! { S("title") });
builder.execute(|_, _| ()).unwrap();
builder.execute(|_| ()).unwrap();
wtxn.commit().unwrap();
let rtxn = index.read_txn().unwrap();
@ -542,10 +542,10 @@ mod tests {
// Set the filterable fields to be the channel.
let mut wtxn = index.write_txn().unwrap();
let mut builder = Settings::new(&mut wtxn, &index, 0);
let mut builder = Settings::new(&mut wtxn, &index);
builder.set_searchable_fields(vec![S("_geo"), S("price")]); // to keep the fields order
builder.set_filterable_fields(hashset! { S("_geo"), S("price") });
builder.execute(|_, _| ()).unwrap();
builder.execute(|_| ()).unwrap();
wtxn.commit().unwrap();
let rtxn = index.read_txn().unwrap();