Es query+aggs handles problems with spaces and horizontal bars

Environment:
es:2.4
brand Type is string
under query+aggs query will get three records: Best , Choice , Products , the three record teams have brand values, and the others are all the same. Elasticsearch splits Best Choice Products into three parts.

the following is the query statement:

 {
    "size": 0,
    "aggs": {....},
    "query": {
        "filtered": {
            "filter": {
                "bool": {
                    "must": [
                        {
                            "match": {
                                "brand": {
                                    "query": "Best Choice Products",
                                    "type": "phrase"
                                }
                            }
                        }
                    ]
                }
            }
        }
    }
}

the following is part of the result
clipboard.png

Mar.28,2021

es aggregates string types for term after word segmentation. If you want to aggregate the original value, use subfields to set a type without word segmentation, and then analyze the aggregation for that type

PUT /my_index
{
  "mappings": {
    "my_type": {
      "properties": {
        "city": {
          "type": "string",
          "fields": {
            "raw": { 
              "type":  "string",
              "index": "not_analyzed"
            }
          }
        }
      }
    }
  }
}

ide/en/elasticsearch/reference/1.4/_multi_fields.html" rel=" nofollow noreferrer "> https://www.elastic.co/guide/.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37d9e-2c0df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37d9e-2c0df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?