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

前端 未结 2 935
没有蜡笔的小新
没有蜡笔的小新 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:40

    From this link you have this statement:

    The other simple types (such as long, double, date etc) also accept the index parameter, but the only relevant values are no and not_analyzed, as their values are never analyzed.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题