asticsearch получает результаты как из фильтра, так и без фильтра - PullRequest
0 голосов
/ 20 февраля 2019
    Lets say i have created four indexes

    1) distributor-info
    2) product-info
    3) store-info
    4) store-distributor-map

    index Mapping
    1)PUT /product_info
        `{
          "mappings": {
            "products": { 
             "properties": { 
                  "id": {"type": "text" },
                  "product":    { "type": "text"  }, 
                  "distributor":     { "type": "text"  }, 
                  "location":      { "type": "text" },
                  "stock":      { "type": "text" },
                  "description":      { "type": "text" },
                  "user-Id":      { "type": "text" }
              }
            }
          }
        }`

    2)
    PUT /store-distributor-map
    `{
      "mappings": {
        "products": { 
          "properties": { 
            "storeid": {"type":"text"},
            "distributorIds":{"type":"nested"}       
          }
        }
      }
    }`

    3) PUT /distributor-info
         `{
           "mappings": {
           "products": { 
            "properties": { 
            "distributor-Id": {"type": "text" },
            "name": { "type": "text"  }, 
            "location":{"type": "text" }        
                       }
                    }
                  }
     }`

    4)PUT /store-info
    `{
      "mappings": {
        "products": { 
          "properties": {
                "storeid":{"type":"text"},
                "distributorIds":{"type":"nested"}   
              }
            }
          }
        }`

На данный момент я получаю идентификаторы дистрибьюторов из store-distributor-map и в зависимости от идентификаторов, которые я ищу из product-info.Я хочу объединить как фильтр, так и результаты без фильтра.Например, мне также нужен продукт, который я получаю от применения идентификатора дистрибьютора
и оставшихся результатов.Но первое предпочтение фильтруется, а затем не фильтруется.Есть ли способ объединить этих двоих?

...