Update examples/json_field.rs

This commit is contained in:
PSeitz
2022-05-23 11:27:05 +02:00
committed by GitHub
parent b2e97e266a
commit 4e2a053b69

View File

@@ -52,6 +52,7 @@ fn main() -> tantivy::Result<()> {
let searcher = reader.searcher();
// # Default fields: event_type and attributes
// By setting attributes as a default field it allows omitting attributes itself, e.g. "target", instead of "attributes.target"
let query_parser = QueryParser::for_index(&index, vec![event_type, attributes]);
{
let query = query_parser.parse_query("target:submit-button")?;