### JSON Document Example Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md An example of a JSON document that will be flattened during indexing. ```json { "user": { "name": "Paul Masurel", "address": { "city": "Tokyo", "country": "Japan" }, "created_at": "2018-11-12T23:20:50.52Z" } } ``` -------------------------------- ### Querying JSON Array Fields Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md A query example that demonstrates how terms from within a JSON array can be matched. ```text cart.product_type:sneakers AND cart.attributes.color:red ``` -------------------------------- ### Clone and Build Tantivy Locally Source: https://github.com/quickwit-oss/tantivy/blob/main/README.md Instructions for cloning the Tantivy repository and running tests locally. Ensure you have Rust stable installed. ```bash git clone https://github.com/quickwit-oss/tantivy.git cd tantivy cargo test ``` -------------------------------- ### Targeting Default JSON Field Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md Example of how to explicitly target a JSON field when a schema field has the same name. ```text json_dynamic.text:hello ``` -------------------------------- ### JSON Document with Array Example Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md A JSON document containing an array, illustrating how it's treated as a bag of terms during search. ```json { "cart_id": 3234234 , "cart": [ {"product_type": "sneakers", "attributes": {"color": "white"} }, {"product_type": "t-shirt", "attributes": {"color": "red"}}, ] } ``` -------------------------------- ### Flattened JSON Tokens Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md The tokens emitted after flattening the example JSON document. ```text - ("name", Text, "Paul") - ("name", Text, "Masurel") - ("address.city", Text, "Tokyo") - ("address.country", Text, "Japan") - ("created_at", Date, 15420648505) ``` -------------------------------- ### Tag and Push Git Version Source: https://github.com/quickwit-oss/tantivy/blob/main/RELEASE.md After publishing, manually create and push a git tag for the new version. Replace '0.25.0' with the actual new version number. ```bash git tag 0.25.0 git push upstream tag 0.25.0 ``` -------------------------------- ### Bump and Publish Packages with Cargo-Release Source: https://github.com/quickwit-oss/tantivy/blob/main/RELEASE.md Use this command to identify changed packages, bump their versions, and prepare them for publishing. Replace '0.24' with the previous tag name and 'minor' with the desired version bump type (e.g., 'patch', 'minor', 'major'). The '--no-tag' flag prevents subpackage tagging. ```bash cargo release --workspace --no-publish -v --prev-tag-name 0.24 --push-remote origin minor --no-tag ``` -------------------------------- ### Fast Field Value Calculation Source: https://github.com/quickwit-oss/tantivy/blob/main/ARCHITECTURE.md Illustrates the formula for fetching a value from a fast field given a DocId, minimum value, number of bits per document, and the bit-packed data. ```rust min_value + fetch_bits(num_bits * doc_id..num_bits * (doc_id+1)) ``` -------------------------------- ### Sorted Flattened JSON Tokens Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md The lexicographical sort order of the flattened JSON tokens. ```text - ("address.city", Text, "Tokyo") - ("address.country", Text, "Japan") - ("name", Text, "Masurel") - ("name", Text, "Paul") - ("created_at", Date, 15420648505) ``` -------------------------------- ### Configure Index Sorting by Field Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/index_sorting.md Set the `sort_by_field` option in `IndexSettings` to specify a field for sorting. Only fast fields are supported. This configuration is passed to the `IndexBuilder`. ```rust let settings = IndexSettings { sort_by_field: Some(IndexSortByField { field: "intval".to_string(), order: Order::Desc, }), ..Default::default() }; let mut index_builder = Index::builder().schema(schema); index_builder = index_builder.settings(settings); let index = index_builder.create_in_ram().unwrap(); ``` -------------------------------- ### Columnar File Structure Source: https://github.com/quickwit-oss/tantivy/blob/main/columnar/README.md Defines the high-level structure of a columnar file, including data, index, and footer sections. Columns are sorted by their column key. ```plaintext COLUMNAR:= [COLUMNAR_DATA] [COLUMNAR_KEY_TO_DATA_INDEX] [COLUMNAR_FOOTER]; # Columns are sorted by their column key. COLUMNAR_DATA:= [COLUMN_DATA]+; COLUMNAR_FOOTER := [RANGE_SSTABLE_BYTES_LEN: 8 bytes little endian] ``` -------------------------------- ### Querying JSON Fields (String/Number) Source: https://github.com/quickwit-oss/tantivy/blob/main/doc/src/json.md How a query for a JSON field value is interpreted, potentially matching both string and numeric types. ```rust (my_path.my_segment, String, 233) or (my_path.my_segment, u64, 233) ``` -------------------------------- ### Exclude Unchanged Packages with Cargo-Release Source: https://github.com/quickwit-oss/tantivy/blob/main/RELEASE.md When cargo-release warns about unchanged packages, use the '--exclude' flag to explicitly ignore them. This command is similar to the previous one but adds an exclusion for 'tokenizer-api'. ```bash cargo release --workspace --no-publish -v --prev-tag-name 0.24 --push-remote origin minor --no-tag --exclude tokenizer-api ``` -------------------------------- ### Inverted Index Term to Posting Mapping Source: https://github.com/quickwit-oss/tantivy/blob/main/ARCHITECTURE.md Represents the conceptual mapping within the inverted index, where a Term maps to its associated Posting information. ```text Term ⟶ Posting ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.