Elasticsearch 论坛实战-使用most_fields策略进行cross-fields search弊端揭秘

Elasticsearch实战

准备数据

# 创建索引
PUT /forum?include_type_name=true
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 1
  },
  "mappings": {
    "post":{
      "properties":{
        "title":{
          "type":"text",
          "analyzer":"english"
        }
      }
    }
  }
}

# 创建两个文档
PUT /forum/post/_bulk
{"index":{"_id":1}}
{"title":"learning too many courses"}
{"index":{"_id":2}}
{"title":"learned more courses"}

 

 

 

 

 

 

 

 

 

 

欢迎咨询公众号《小马JAVA》 

Elasticsearch 论坛实战-使用most_fields策略进行cross-fields search弊端揭秘

上一篇:UBoot的编译与烧写


下一篇:【图论】深度优先搜索树