Elasticsearch count terms ignoring spaces

后端 未结 2 2101
天命终不由人
天命终不由人 2021-02-06 04:41

Using ES 1.2.1

My aggregation

{
    \"size\": 0,
    \"aggs\": {
        \"cities\": {
            \"terms\": {
                \"field\": \"city\",\"siz         


        
2条回答
  •  一个人的身影
    2021-02-06 05:17

    There are 2 approaches to solve this.

    1. The not_analyzed way - But this wont consider different capital and small cases
    2. The keyword tokenizer way - Here we can map different terms with different case as one.

    These two concepts with working code examples are illustrated in this blog.

提交回复
热议问题