Skip to content

mapping tranlation #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions guide/reference/mapping/all-field.textile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
layout: guide
title: All Field
title: All字段
cat: guide
sidebar: reference_mapping
---

p. The idea of the @_all@ field is that it includes the text of one or more other fields within the document indexed. It can come very handy especially for search requests, where we want to execute a search query against the content of a document, without knowing which fields to search on. This comes at the expense of CPU cycles and index size.

p. The @_all@ fields can be completely disabled. Explicit field mapping and object mapping can be excluded / included in the @_all@ field. By default, it is enabled and all fields are included in it for ease of use.
p. @_all@ 字段用于映射索引文档中一个或多个字段包含的内容。在不知道该搜索字段的时候,只需要字段内容便能完成对文档的搜索,这方便了我们的搜索请求。其代价是cpu轮询和索引大小的开销。

p. One of the nice features of the @_all@ field is that it takes into account specific fields boost levels. Meaning that if a title field is boosted more than content, the title (part) in the @_all@ field will mean more than the content (part) in the @_all@ field.

p. Here is a sample mapping:
p. @_all@ 字段可以被完全禁用。理想的字段映射和对象映射可以排除/包含在 @_all@ 字段中。默认配置是, @_all@ 字段是可用的且所有字段都被包含在内(为了方便使用)


p. @_all@ 字段的一个很好的特性是它支持特定字段的等级标榜。这意味着如果一个title字段标榜的比内容更多, @_all@ 字段的title部分将也会比 @_all@ 字段中的内容部分标榜的更多。

p. 下面是一个映射例子:


<pre class="prettyprint lang-js">
{
Expand Down Expand Up @@ -49,11 +53,13 @@ p. Here is a sample mapping:
}
</pre>

p. The @_all@ fields allows for @store@, @term_vector@ and @analyzer@ (with specific @index_analyzer@ and @search_analyzer@) to be set.

h2. Highlighting
p. _all字段允许设置@store@, @term_vector@ 和 @analyzer@ (带有特定的 @index_analyzer@ 和 @search_analyzer@)

h2. 高亮


For any field to allow "highlighting":../api/search/highlighting.html it has to be either stored or part of the @_source@ field. By default @_all@ field does not qualify for either, so highlighting for it does not yield any data.
对于允许"高亮":../api/search/highlighting.html 的字段,他要么被存储要么成为_source字段的一部分。默认情况下,@_all@ 字段并不会做任何修饰, 所以其高亮并不产生任何数据。

Although it is possible to @store@ the @_all@ field, it is basically an aggregation of all fields, which means more data will be stored, and highlighting it might produce strange results.
尽管 @store@ @_all@ 字段是可能的,但是它是所有字段的一个聚合,这表示更多的数据会被存储,并高亮其生成的奇怪的结果。

20 changes: 13 additions & 7 deletions guide/reference/mapping/analyzer-field.textile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
layout: guide
title: Analyzer Field
title: 分析器字段
cat: guide
sidebar: reference_mapping
---

p. The @_analyzer@ mapping allows to use a document field property as the name of the analyzer that will be used to index the document. The analyzer will be used for any field that does not explicitly defines an @analyzer@ or @index_analyzer@ when indexing.

p. Here is a simple mapping:

p. @_analyzer@ 映射允许用一个文档字段的属性做个分析器的名字并索引该文档。分析器会被用于任何字段,在索引时,字段可以是非明确定义一个 @_analyzer@ 或是 @index_analyzer@


p. 这是一个简单的映射

<pre class="prettyprint lang-js">
{
Expand All @@ -19,16 +22,19 @@ p. Here is a simple mapping:
}
</pre>

p. The above will use the value of the @my_field@ to lookup an analyzer registered under it. For example, indexing a the following doc:

p. 以上表示将会使用 @my_field@ 的值去查询一个在其后注册的分析器。例如,索引接下来的文档。

<pre class="prettyprint lang-js">
{
"my_field" : "whitespace"
}
</pre>

p. Will cause the @whitespace@ analyzer to be used as the index analyzer for all fields without explicit analyzer setting.

p. The default path value is @_analyzer@, so the analyzer can be driven for a specific document by setting @_analyzer@ field in it. If custom json field name is needed, an explicit mapping with a different path should be set.
p. 将会导致 @whitespace@ 分析器被用于索引分析器,该索引分析器可以是没有明确设置分析器的所有字段

p. 默认的路径值是 @_analyzer@ ,所以分析器可以被特定的文档通过设置期内的 @_analyzer@ 字段 来调取。如果需要定制的json字段名, 则应当设置一个不明确的不同路径的映射


p. By default, the @_analyzer@ field is indexed, it can be disabled by settings @index@ to @no@ in the mapping.
p. 默认情况下, @_analyzer@ 字段是被索引的, 这可以通过在映射中设置 @index@ @no@ 来禁用