小编Jas*_*Wan的帖子

Elasticsearch按内部命中排序父级doc count

假设我正在为Elasticsearch索引一堆产品可用的Products和Stores.例如,文档看起来像:

{
  name: "iPhone 6s",
  price: 600.0,
  stores: [
    {
      name: "Apple Store Union Square",
      location: "San Francisco, CA"
    },
    {
      name: "Target Cupertino",
      location: "Cupertino, CA"
    },
    {
      name: "Apple Store 5th Avenue",
      location: "New York, NY"
    }
    ...
  ]
}
Run Code Online (Sandbox Code Playgroud)

并使用该nested类型,映射将是:

"mappings" : {
  "product" : {
    "properties" : {
      "name" : {
        "type" : "string"
      },
      "price" : {
        "type" : "float"
      },
      "stores" : {
        "type" : "nested",
        "properties" : …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

4
推荐指数
1
解决办法
2042
查看次数

标签 统计

elasticsearch ×1