elasticsearch,Lucene,elasticsearch" /> elasticsearch,Lucene,elasticsearch" />

Lucene 如何在Elasticsearch中启用词干分析?

Lucene 如何在Elasticsearch中启用词干分析?,lucene,elasticsearch,Lucene,elasticsearch,我目前有一个创建索引的bash脚本。代码在上面 如何向其添加词干 最通用的方法是用雪球分析器替换默认分析器。这将为所有动态映射的字符串字段启用词干分析。以下是启用英语词干分析器的方法: curl -XPUT "localhost:9200/products" -d '{ "settings": { "index": { "number_of_replicas" : 0, "number_of_shards": 1

我目前有一个创建索引的bash脚本。代码在上面


如何向其添加词干

最通用的方法是用
雪球
分析器替换
默认
分析器。这将为所有动态映射的字符串字段启用词干分析。以下是启用英语词干分析器的方法:

curl -XPUT "localhost:9200/products" -d '{
    "settings": {
        "index": {
            "number_of_replicas" : 0,
            "number_of_shards": 1
        }
    },
    "mappings": {
        "products": {
            "properties": {
                "location" : {
                    "type" : "geo_point"
                }
            }
        }
    }
}'

映射是怎么回事?这跟这事有关系吗?
curl -XPUT "localhost:9200/products" -d '{
    "settings": {
        "index": {
            "number_of_replicas" : 0,
            "number_of_shards": 1,
            "analysis" :{
                "analyzer": {
                    "default": {
                        "type" : "snowball",
                        "language" : "English"
                    }
                }
            }  
        }
    },
    "mappings": {
        "products": {
            "properties": {
                "location" : {
                    "type" : "geo_point"
                }
            }
        }
    }
}'