From 979e686258a19f0b14913e28534d39f40b68d96c Mon Sep 17 00:00:00 2001 From: JerryKwan Date: Mon, 25 Sep 2023 18:02:24 +0800 Subject: [PATCH] update quickstart document (#3871) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update quickstart update quickstart to show the usage of document dynamic mapping * Update docs/get-started/quickstart.md Co-authored-by: François Massot * update default value of mode in index config update defualt value of mode to dynamic in index configuration * Update docs/get-started/quickstart.md Co-authored-by: François Massot --------- Co-authored-by: François Massot --- .../tutorials/stackoverflow/index-config.yaml | 18 --------------- docs/configuration/index-config.md | 2 +- docs/get-started/quickstart.md | 22 ++----------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/config/tutorials/stackoverflow/index-config.yaml b/config/tutorials/stackoverflow/index-config.yaml index 3047bf0adcf..d9642e9b16b 100644 --- a/config/tutorials/stackoverflow/index-config.yaml +++ b/config/tutorials/stackoverflow/index-config.yaml @@ -7,18 +7,6 @@ index_id: stackoverflow doc_mapping: field_mappings: - - name: user - type: text - fast: true - tokenizer: raw - - name: tags - type: array - fast: true - tokenizer: raw - - name: type - type: text - fast: true - tokenizer: raw - name: title type: text tokenizer: default @@ -29,12 +17,6 @@ doc_mapping: tokenizer: default record: position stored: true - - name: questionId - type: u64 - - name: answerId - type: u64 - - name: acceptedAnswerId - type: u64 - name: creationDate type: datetime fast: true diff --git a/docs/configuration/index-config.md b/docs/configuration/index-config.md index 632d4bbd0f4..159dbfff20e 100644 --- a/docs/configuration/index-config.md +++ b/docs/configuration/index-config.md @@ -87,7 +87,7 @@ The doc mapping defines how a document and the fields it contains are stored and | Variable | Description | Default value | | ------------- | ------------- | ------------- | | `field_mappings` | Collection of field mapping, each having its own data type (text, binary, datetime, bool, i64, u64, f64). | `[]` | -| `mode` | Defines how quickwit should handle document fields that are not present in the `field_mappings`. In particular, the "dynamic" mode makes it possible to use quickwit in a schemaless manner. (See [mode](#mode)) | `lenient` +| `mode` | Defines how quickwit should handle document fields that are not present in the `field_mappings`. In particular, the "dynamic" mode makes it possible to use quickwit in a schemaless manner. (See [mode](#mode)) | `dynamic` | `dynamic_mapping` | This parameter is only allowed when `mode` is set to `dynamic`. It then defines whether dynamically mapped fields should be indexed, stored, etc. | (See [mode](#mode)) | `tag_fields` | Collection of fields* already defined in `field_mappings` whose values will be stored as part of the `tags` metadata. [Learn more about tags](../overview/concepts/querying.md#tag-pruning). | `[]` | | `store_source` | Whether or not the original JSON document is stored or not in the index. | `false` | diff --git a/docs/get-started/quickstart.md b/docs/get-started/quickstart.md index ae08988b6fb..5bc5f8b0308 100644 --- a/docs/get-started/quickstart.md +++ b/docs/get-started/quickstart.md @@ -79,7 +79,7 @@ Let's create an index configured to receive Stackoverflow posts (questions and a curl -o stackoverflow-index-config.yaml https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/stackoverflow/index-config.yaml ``` -The index config defines nine text fields. Among them there are five text fields: `user`, `tags`, `title`, `type` and `body`. Two of these fields, `body` and `title` are [indexed and tokenized](../configuration/index-config.md#text-type) and they are also used as default search fields, which means they will be used for search if you do not target a specific field in your query. The `tags` field is configured to accept multiple text values. The rest of the text fields are not tokenized and configured as [fast](/docs/configuration/index-config.md#text-type). There are three numeric fields `questionId`, `answerId` and `acceptedAnswerId`. And there is the `creationDate` field that serves as the timestamp for each record. +The index config defines three fields: `title`, `body` and `creationDate`. `title` and `body` are [indexed and tokenized](../configuration/index-config.md#text-type), and they are also used as default search fields, which means they will be used for search if you do not target a specific field in your query. `creationDate` serves as the timestamp for each record. There are no more explicit field definitions as we can use the default dynamic [mode](/docs/configuration/index-config.md#mode): the undeclared fields will still be indexed, by default fast fields are enabled to enable aggregation queries. and the `raw` tokenizer is used for text. And here is the complete config: @@ -93,18 +93,6 @@ index_id: stackoverflow doc_mapping: field_mappings: - - name: user - type: text - fast: true - tokenizer: raw - - name: tags - type: array - fast: true - tokenizer: raw - - name: type - type: text - fast: true - tokenizer: raw - name: title type: text tokenizer: default @@ -115,12 +103,6 @@ doc_mapping: tokenizer: default record: position stored: true - - name: questionId - type: u64 - - name: answerId - type: u64 - - name: acceptedAnswerId - type: u64 - name: creationDate type: datetime fast: true @@ -133,7 +115,7 @@ search_settings: default_search_fields: [title, body] indexing_settings: - commit_timeout_secs: 5 + commit_timeout_secs: 10 ``` Now we can create the index with the command: