Why the query result of match_phrase_prefix and prefix is different

wildcard query

GET information/_validate/query?explain
{
  "query": {
    "bool": {
      "should": [
        {
          "wildcard": {
            "title": "cve-2018*"
          }
        },
        {
          "wildcard": {
            "content": "cve-2018*"
          }
        }
      ]
    }
  }
}

the explain result of wildcard query


{
  "valid": true,
  "_shards": {
    "total": 12,
    "successful": 12,
    "failed": 0
  },
  "explanations": [
    {
      "index": "manual_infos",
      "valid": true,
      "explanation": "title:cve-2018* content:cve-2018*"
    },
    {
      "index": "twitter-com",
      "valid": true,
      "explanation": "title:cve-2018* content:cve-2018*"
    }
  ]
}

match_phrase_prefix query

GET information/_validate/query?explain
{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase_prefix": {
            "title": {
              "query": "cve-2018"
            }
          }
        },
        {
          "match_phrase_prefix": {
            "content": {
              "query": "cve-2018"
            }
          }
        }
      ]
    }
  }
}

the explain result of match_phrase_prefix query , and the result is a malformed json

{
  "valid": true,
  "_shards": {
    "total": 12,
    "successful": 12,
    "failed": 0
  },
  "explanations": [
    {
      "index": "manual_infos",
      "valid": true,
      "explanation": """title:"cve-2018*" content:"cve-2018*""""
    },
    {
      "index": "twitter-com",
      "valid": true,
      "explanation": """title:"cve-2018*" content:"cve-2018*""""
    }
  ]
}

version about

  • elasticsearch version: 5.6.4
  • kibana version: 5.6.4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.