Skip to content

Commit b22f966

Browse files
authored
doc: update comments in the faceted search example (#1737)
* doc: update comments in the faceted search example * chore: format
1 parent b78dc5e commit b22f966

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

examples/faceted_search.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
// # Basic Example
1+
// # Faceted Search
22
//
3-
// This example covers the basic functionalities of
3+
// This example covers the faceted search functionalities of
44
// tantivy.
55
//
66
// We will :
7-
// - define our schema
8-
// = create an index in a directory
9-
// - index few documents in our index
10-
// - search for the best document matchings "sea whale"
11-
// - retrieve the best document original content.
12-
7+
// - define a text field "name" in our schema
8+
// - define a facet field "classification" in our schema
9+
// - create an index in memory
10+
// - index few documents with respective facets in our index
11+
// - search and count the number of documents that the classifications start the facet "/Felidae"
12+
// - Search the facet "/Felidae/Pantherinae" and count the number of documents that the
13+
// classifications include the facet.
14+
//
1315
// ---
1416
// Importing tantivy...
1517
use tantivy::collector::FacetCollector;
@@ -21,7 +23,7 @@ fn main() -> tantivy::Result<()> {
2123
// Let's create a temporary directory for the sake of this example
2224
let mut schema_builder = Schema::builder();
2325

24-
let name = schema_builder.add_text_field("felin_name", TEXT | STORED);
26+
let name = schema_builder.add_text_field("name", TEXT | STORED);
2527
// this is our faceted field: its scientific classification
2628
let classification = schema_builder.add_facet_field("classification", FacetOptions::default());
2729

0 commit comments

Comments
 (0)