From 091428790d286076b4eef2636f6951b48ca7ec5d Mon Sep 17 00:00:00 2001 From: yichao Date: Wed, 14 Sep 2016 11:47:33 +0800 Subject: [PATCH 1/3] chapter10_part8:/070_Index_Mgmt/32_Metadata_all.asciidoc --- 070_Index_Mgmt/32_Metadata_all.asciidoc | 47 ++++++------------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/070_Index_Mgmt/32_Metadata_all.asciidoc b/070_Index_Mgmt/32_Metadata_all.asciidoc index d4b61c819..24f8ac64d 100644 --- a/070_Index_Mgmt/32_Metadata_all.asciidoc +++ b/070_Index_Mgmt/32_Metadata_all.asciidoc @@ -1,15 +1,10 @@ [[all-field]] -==== Metadata: _all Field +==== 元数据: _all 字段 -In <>, we introduced the `_all` field: a special field that -indexes the ((("metadata, document", "_all field")))((("_all field", sortas="all field")))values from all other fields as one big string. The `query_string` -query clause (and searches performed as `?q=john`) defaults to searching in -the `_all` field if no other field is specified. +在 <> 中,我们介绍了 `_all` 字段:一个索引所有字段((("metadata, document", "_all field")))((("_all field", sortas="all field")))作为一个大字段的特殊字段。 `query_string` +查询子句 (搜索 `?q=john`) 在没有指定字段时默认使用 `_all` 字段。 -The `_all` field is useful during the exploratory phase of a new application, -while you are still unsure about the final structure that your documents will -have. You can throw any query string at it and you have a good chance of -finding the document you're after: + `_all` 字段在新应用的探索阶段,当你还不清楚文档的最终结构时是比较有用的。你可以使用这个字段来做任何查询,并且有很大可能找到需要的文档: [source,js] -------------------------------------------------- @@ -22,24 +17,14 @@ GET /_search -------------------------------------------------- -As your application evolves and your search requirements become more exacting, -you will find yourself using the `_all` field less and less. The `_all` field -is a shotgun approach to search. By querying individual fields, you have more -flexbility, power, and fine-grained control over which results are considered -to be most relevant. +随着应用的发展,搜索需求变得更加明确,你会发现自己使用 `_all` 字段越来越少。 `_all` 字段是搜索的应急之策。通过查询指定字段,你可以更加灵活,强大和精准的控制搜索结果,提高相关性。 [NOTE] ==== -One of the important factors taken into account by the -<> -is the length of the field: the shorter the field, the more important. A term -that appears in a short `title` field is likely to be more important than the -same term that appears somewhere in a long `content` field. This distinction -between field lengths disappears in the `_all` field. +<> 考虑的一个最重要的原则是字段的长度:字段越短越重要。 在较短的 `title` 字段中出现的短语可能比在较长的 `content` 字段中出现的短语更加重要。字段长度的区别在 `_all` 字段中不会出现。 ==== -If you decide that you no longer need the `_all` field, you can disable it -with this mapping: +如果你不再需要 `_all` 字段,你可以通过下面的映射来禁用: [source,js] -------------------------------------------------- @@ -51,17 +36,9 @@ PUT /my_index/_mapping/my_type } -------------------------------------------------- +通过 `include_in_all` 设置来逐个控制字段是否要包含在 `_all` 字段中,((("include_in_all setting")))默认值是 `true`。在一个对象(或根对象)上设置 `include_in_all` 可以修改这个对象中的所有字段的默认行为。 -Inclusion in the `_all` field can be controlled on a field-by-field basis -by using the `include_in_all` setting, ((("include_in_all setting")))which defaults to `true`. Setting -`include_in_all` on an object (or on the root object) changes the -default for all fields within that object. - -You may find that you want to keep the `_all` field around to use -as a catchall full-text field just for specific fields, such as -`title`, `overview`, `summary`, and `tags`. Instead of disabling the `_all` -field completely, disable `include_in_all` for all fields by default, -and enable it only on the fields you choose: +你可能想要保留 `_all` 字段作为一个全文字段,例如 `title`,`overview`,`summary` 和 `tags`。 相对于完成禁用 `_all` 字段,你可以为所有字段默认禁用 `include_in_all` 选项,仅在你选择的字段上启用: [source,js] -------------------------------------------------- @@ -81,11 +58,7 @@ PUT /my_index/my_type/_mapping -------------------------------------------------- -Remember that the `_all` field is just((("analyzers", "configuring for all field"))) an analyzed `string` field. It -uses the default analyzer to analyze its values, regardless of which -analyzer has been set on the fields where the values originate. And -like any `string` field, you can configure which analyzer the `_all` -field should use: +记住,`_all` 字段仅仅是一个((("analyzers", "configuring for all field"))) 进过分析的 `string` 字段。它使用默认分词器来分析它的值,不管这个值原本所在字段指定的分词器。就像所有 `string` 字段,你可以配置 `_all` 字段使用的分词器: [source,js] -------------------------------------------------- From 42f2a29808ccafb71234fbf2fd6961d05488908e Mon Sep 17 00:00:00 2001 From: yichao Date: Sun, 25 Sep 2016 19:51:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?review=E5=90=8E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 070_Index_Mgmt/32_Metadata_all.asciidoc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/070_Index_Mgmt/32_Metadata_all.asciidoc b/070_Index_Mgmt/32_Metadata_all.asciidoc index 24f8ac64d..ba02e0e19 100644 --- a/070_Index_Mgmt/32_Metadata_all.asciidoc +++ b/070_Index_Mgmt/32_Metadata_all.asciidoc @@ -1,10 +1,9 @@ [[all-field]] ==== 元数据: _all 字段 -在 <> 中,我们介绍了 `_all` 字段:一个索引所有字段((("metadata, document", "_all field")))((("_all field", sortas="all field")))作为一个大字段的特殊字段。 `query_string` -查询子句 (搜索 `?q=john`) 在没有指定字段时默认使用 `_all` 字段。 +在 <> 中,我们介绍了 `_all` 字段:一个把其它字段值((("metadata, document", "_all field")))((("_all field", sortas="all field")))当作一个大字符串来索引的特殊字段。 `query_string` 查询子句(搜索 `?q=john` )在没有指定字段时默认使用 `_all` 字段。 - `_all` 字段在新应用的探索阶段,当你还不清楚文档的最终结构时是比较有用的。你可以使用这个字段来做任何查询,并且有很大可能找到需要的文档: +`_all` 字段在新应用的探索阶段,当你还不清楚文档的最终结构时是比较有用的。你可以使用这个字段来做任何查询,并且有很大可能找到需要的文档: [source,js] -------------------------------------------------- @@ -38,7 +37,7 @@ PUT /my_index/_mapping/my_type 通过 `include_in_all` 设置来逐个控制字段是否要包含在 `_all` 字段中,((("include_in_all setting")))默认值是 `true`。在一个对象(或根对象)上设置 `include_in_all` 可以修改这个对象中的所有字段的默认行为。 -你可能想要保留 `_all` 字段作为一个全文字段,例如 `title`,`overview`,`summary` 和 `tags`。 相对于完成禁用 `_all` 字段,你可以为所有字段默认禁用 `include_in_all` 选项,仅在你选择的字段上启用: +你可能想要保留 `_all` 字段作为一个全文字段,例如 `title`,`overview`,`summary` 和 `tags`。 相对于完全禁用 `_all` 字段,你可以为所有字段默认禁用 `include_in_all` 选项,仅在你选择的字段上启用: [source,js] -------------------------------------------------- @@ -58,7 +57,7 @@ PUT /my_index/my_type/_mapping -------------------------------------------------- -记住,`_all` 字段仅仅是一个((("analyzers", "configuring for all field"))) 进过分析的 `string` 字段。它使用默认分词器来分析它的值,不管这个值原本所在字段指定的分词器。就像所有 `string` 字段,你可以配置 `_all` 字段使用的分词器: +记住,`_all` 字段仅仅是一个((("analyzers", "configuring for all field"))) 进过分词的 `string` 字段。它使用默认分词器来分析它的值,不管这个值原本所在字段指定的分词器。就像所有 `string` 字段,你可以配置 `_all` 字段使用的分词器: [source,js] -------------------------------------------------- From 9e4387bc54cfde861a394873049c40c620ba52de Mon Sep 17 00:00:00 2001 From: yichao Date: Fri, 14 Oct 2016 10:05:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BA=8C=E6=AC=A1review=E5=90=8E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 070_Index_Mgmt/32_Metadata_all.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/070_Index_Mgmt/32_Metadata_all.asciidoc b/070_Index_Mgmt/32_Metadata_all.asciidoc index ba02e0e19..82dfe1677 100644 --- a/070_Index_Mgmt/32_Metadata_all.asciidoc +++ b/070_Index_Mgmt/32_Metadata_all.asciidoc @@ -16,7 +16,7 @@ GET /_search -------------------------------------------------- -随着应用的发展,搜索需求变得更加明确,你会发现自己使用 `_all` 字段越来越少。 `_all` 字段是搜索的应急之策。通过查询指定字段,你可以更加灵活,强大和精准的控制搜索结果,提高相关性。 +随着应用的发展,搜索需求变得更加明确,你会发现自己越来越少使用 `_all` 字段。 `_all` 字段是搜索的应急之策。通过查询指定字段,你的查询更加灵活、强大,你也可以对相关性最高的搜索结果进行更细粒度的控制。 [NOTE] ==== @@ -37,7 +37,7 @@ PUT /my_index/_mapping/my_type 通过 `include_in_all` 设置来逐个控制字段是否要包含在 `_all` 字段中,((("include_in_all setting")))默认值是 `true`。在一个对象(或根对象)上设置 `include_in_all` 可以修改这个对象中的所有字段的默认行为。 -你可能想要保留 `_all` 字段作为一个全文字段,例如 `title`,`overview`,`summary` 和 `tags`。 相对于完全禁用 `_all` 字段,你可以为所有字段默认禁用 `include_in_all` 选项,仅在你选择的字段上启用: +你可能想要保留 `_all` 字段作为一个只包含某些特定字段的全文字段,例如只包含 `title`,`overview`,`summary` 和 `tags`。 相对于完全禁用 `_all` 字段,你可以为所有字段默认禁用 `include_in_all` 选项,仅在你选择的字段上启用: [source,js] -------------------------------------------------- @@ -57,7 +57,7 @@ PUT /my_index/my_type/_mapping -------------------------------------------------- -记住,`_all` 字段仅仅是一个((("analyzers", "configuring for all field"))) 进过分词的 `string` 字段。它使用默认分词器来分析它的值,不管这个值原本所在字段指定的分词器。就像所有 `string` 字段,你可以配置 `_all` 字段使用的分词器: +记住,`_all` 字段仅仅是一个((("analyzers", "configuring for all field"))) 经过分词的 `string` 字段。它使用默认分词器来分析它的值,不管这个值原本所在字段指定的分词器。就像所有 `string` 字段,你可以配置 `_all` 字段使用的分词器: [source,js] --------------------------------------------------