标记弹性搜索慢查询

标记弹性搜索慢查询

本文介绍了标记弹性搜索慢查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ElasticSearch群集位于AWS云中,并且版本7.8.我试图标记我的弹性搜索查询,以便一旦在慢速查询日志中找到慢速查询的发起者,便可以识别谁.我浏览了elastic.co指南

解决方案

您所引用的文档适用于应用搜索,它是Elastic Stack的另一种产品,而不是Elasticsearch本身.

您需要做的是使用命名查询,它使您可以执行与预期几乎相同的操作.

您可以做的只是标记顶级 bool 查询

 "query":{布尔":{"_name":"your-client-tag",必须":[{布尔":{ 

My ElasticSearch cluster is in AWS cloud and is on version 7.8. I am trying to tag my elastic search queries so that I can identify who are the originators of the slow queries once I have them in the slow query log. I went through the elastic.co guide here which outlines the procedure to use analytics key to add tags to the query.

However, when I run my query with the analytics tag I get the error below. Also, PFA below a snapshot of the query and response.

Can someone suggest what I am doing wrong ?

Secondly, If analytics tag is something which is not available in AWS ElasticSearch then can someone suggest that what could be the alternatives to tag my queries ?

{
  "error" : {
    "root_cause" : [
      {
        "type" : "parsing_exception",
        "reason" : "Unknown key for a START_OBJECT in [analytics].",
        "line" : 156,
        "col" : 16
      }
    ],
    "type" : "parsing_exception",
    "reason" : "Unknown key for a START_OBJECT in [analytics].",
    "line" : 156,
    "col" : 16
  },
  "status" : 400
}
解决方案

The documentation you're referring to is for App Search which is another product of the Elastic Stack but not Elasticsearch itself.

What you need to do instead is to use named queries which allow you to do pretty much the same as you expect.

What you can do is simply tag the top-level bool query

"query": {
  "bool": {
    "_name": "your-client-tag",
    "must": [
      {
       "bool": {

这篇关于标记弹性搜索慢查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:16