当前位置: 首页 > elasticsearch, 搜索 > 正文

翻译 elasticsearch _analyzer

关键字:
1 星2 星3 星4 星5 星 (1 次投票, 评分: 5.00, 总分: 5)
Loading ... Loading ...
baidu_share

原文地址:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-analyzer-field.html

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.

_analyzer映射允许用一个文档的field属性作为分词(analyzer)的名字,它将被用来索引这个文档。当索引未明确指定analyzer 或者index_analyzer 时,analyzer 将被运用在任何field的属性中。

Here is a simple mapping(这是一个简单映射):

{
    "type1" : {
        "_analyzer" : {
            "path" : "my_field"
        }
    }
}

The above will use the value of the my_field to lookup an analyzer registered under it. For example, indexing a the following doc:
将使用上面的my_field的值的查询analyzer的位置.例如,索引下面的文档:

{
    "my_field" : "whitespace"
}

所有字段未明确设定analyzer值,将会设置whitespace作为索引的analyzer。

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.

默认路径是_analyzer,因此,analyzer可以被驱动为一个特定的文档,其通过设置_analyzer字段中。如果需要定制JSON字段名,不同的路径应设置一个明确的映射。

By default, the _analyzer field is indexed, it can be disabled by settings index to no in the mapping.
默认,_analyzer 字段是被索引的。在映射时,它可以被禁止,设置index 为no 。

本文固定链接: http://www.chepoo.com/translate-elasticsearch-_analyzer.html | IT技术精华网

翻译 elasticsearch _analyzer:等您坐沙发呢!

发表评论