如何使用percolator索引查询其他索引Elastic 6.5中的文档

时间:2018-12-21 20:06:29

标签: elasticsearch kibana

我有电子邮件索引(名称:“电子邮件”)。我只是用查询设置了新索引(名称:“ questions”)。每次收到新电子邮件时,带有该电子邮件的新文档都会添加到索引“电子邮件”中。 我想检查添加到索引“电子邮件”的新电子邮件是否与索引“问题”中包含的查询匹配。我的想法是使用渗滤器。我想检查电子邮件的正文,即“邮件”字段。 有可能实现吗? 如果是,请问:如何使用DSL(Kibana DevTools)组合这些索引?

{  
   "took":0,
   "timed_out":false,
   "_shards":{  
      "total":5,
      "successful":5,
      "skipped":0,
      "failed":0
   },
   "hits":{  
      "total":1,
      "max_score":1,
      "hits":[  
         {  
            "_index":"emails",
            "_type":"doc",
            "_id":"23dfadfa",
            "_score":1,
            "_source":{  
               "message-id":"<ouoiopo>",
               "message":"abc",
               "@version":"1",
               "subject":"My title is xyz"
            }
         }
      ]
   }
}

{  
   "took":1,
   "timed_out":false,
   "_shards":{  
      "total":5,
      "successful":5,
      "skipped":0,
      "failed":0
   },
   "hits":{  
      "total":2,
      "max_score":1,
      "hits":[  
         {  
            "_index":"questions",
            "_type":"doc",
            "_id":"2",
            "_score":1,
            "_source":{  
               "query":{  
                  "match":{  
                     "message":"question abc"
                  }
               }
            }
         },
         {  
            "_index":"questions",
            "_type":"doc",
            "_id":"3",
            "_score":1,
            "_source":{  
               "query":{  
                  "match":{  
                     "message":"question def"
                  }
               }
            }
         }
      ]
   }
}

0 个答案:

没有答案