Are numbers: integer, long, float etc… in Elasticsearch not_analyzed?

前端 未结 2 936
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 21:01

Using Elasticsearch 1.4.3

I went through the docs but I\'m not sure exactly. But I figure that integer, long, float, double etc... are indexed as not_analyzed by Luc

2条回答
  •  既然无缘
    2020-12-20 21:51

    Simple, non-string types (such as long, double, date etc) are not analyzed by default.

    That's why you can omit "index": "not_analyzed" in the following mapping definition:

    ...
    "mappings": {
        "properties": {
            "price": {
                "type": "long",
                "index": "not_analyzed"
            }
        }
    }
    ...
    

    But you might decide to not index this field at all:

    ...
    "mappings": {
        "properties": {
            "price": {
                "type": "long",
                "index": "no"
            }
        }
    }
    ...
    

    As a result this field will not be searchable.

    Find the resource here

提交回复
热议问题