ElasticSearch- "Request not registered ..."

ElasticSearch returns me "No request logged for error [likes_count]" when I try to search for records using the following request. The lik_count field is a new document field and does not exist in every document.

The same query works without the sorting part.

Why does this error appear?

thank

{
  "query": {
    "filtered": {
      "query": {
        "query_string": {
          "fields": ["description"],
          "query": "sun"
        },
        "sort": [{
          "likes_count": {
            "unmapped_type": "boolean",
            "order": "desc",
            "missing": "_last"
          }
        }]
      },
      "filter": {"term": {"permissions": 1}}
    }
  }
}

      

+3


source to share


1 answer


Write your request like this, i.e. sort

you need to go to the top level and not nest in the part query

:



{
  "query": {
    "filtered": {
      "query": {
        "query_string": {
          "fields": [
            "description"
          ],
          "query": "sun"
        }
      },
      "filter": {
        "term": {
          "permissions": 1
        }
      }
    }
  },
  "sort": [
    {
      "likes_count": {
        "unmapped_type": "boolean",
        "order": "desc",
        "missing": "_last"
      }
    }
  ]
}

      

+2


source







All Articles