Returning Result in some of the API (#880)

* Returning Result in some of the API

* Introducing `.writer_for_test(..)`
This commit is contained in:
Paul Masurel
2020-09-07 15:52:34 +09:00
committed by GitHub
parent 6530bf0eae
commit 439d6956a9
35 changed files with 339 additions and 356 deletions

View File

@@ -32,7 +32,7 @@ mod tests {
let index = Index::create_in_ram(schema);
{
// writing the segment
let mut index_writer = index.writer_with_num_threads(1, 3_000_000).unwrap();
let mut index_writer = index.writer_for_tests().unwrap();
{
index_writer.add_document(doc!(text_field => "a b c"));
index_writer.add_document(doc!(text_field => "a c"));
@@ -224,7 +224,7 @@ mod tests {
let schema = schema_builder.build();
let index = Index::create_in_ram(schema);
{
let mut index_writer = index.writer_with_num_threads(1, 3_000_000).unwrap();
let mut index_writer = index.writer_for_tests().unwrap();
index_writer.add_document(doc!(text_field => "a b c"));
index_writer.add_document(doc!(text_field => "a c"));
index_writer.add_document(doc!(text_field => "b c"));