Skip to content

Commit

Permalink
More up to date version of tantivy dep
Browse files Browse the repository at this point in the history
tantivy: 4f5ce12a77c7a70cf90f5bee34cd697e3be0aa1b
  • Loading branch information
nicot committed Jan 6, 2018
1 parent 6134dd2 commit 99fe211
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 76 deletions.
103 changes: 64 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ log = "0.3"
futures = "0.1"
env_logger = "0.3"
version = "2"
tantivy = "0.4.3"
# tantivy = "0.4.3"

[dependencies.tantivy]
path = "../tantivy"

[[bin]]
name = "tantivy"
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,36 @@ Answer the questions as follows:
Add another field (Y/N) ? N
[
{
{
"name": "title",
"type": "text",
"options": {
"indexing": "position",
"stored": true
"indexing": {
"record": "position",
"tokenizer": "default"
},
"stored": true
}
},
{
},
{
"name": "body",
"type": "text",
"options": {
"indexing": "position",
"stored": true
"indexing": {
"record": "position",
"tokenizer": "default"
},
"stored": true
}
},
{
},
{
"name": "url",
"type": "text",
"options": {
"indexing": "unindexed",
"stored": true
"indexing": null,
"stored": true
}
}
}
]
Expand Down
4 changes: 3 additions & 1 deletion src/commands/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::fs::File;
use tantivy::collector::chain;
use tantivy::collector::TopCollector;
use tantivy::collector::CountCollector;
use tantivy::tokenizer::TokenizerManager;
use clap::ArgMatches;
use std::path::PathBuf;

Expand Down Expand Up @@ -58,7 +59,8 @@ fn run_bench(index_path: &Path,
let searcher = index.searcher();
let default_search_fields: Vec<Field> = extract_search_fields(&index.schema());
let queries = try!(read_query_file(query_filepath).map_err(|e| format!("Failed reading the query file: {}", e)));
let query_parser = QueryParser::new(index.schema(), default_search_fields);
let tokenizer_manager = TokenizerManager::default();
let query_parser = QueryParser::new(index.schema(), default_search_fields, tokenizer_manager);

println!("SEARCH\n");
println!("{}\t{}\t{}\t{}", "query", "num_terms", "num hits", "time in microsecs");
Expand Down
Loading

0 comments on commit 99fe211

Please sign in to comment.