dongzuozhu66776 2017-10-18 21:50
浏览 298

Elasticsearch获取日期类型的所有字段

I'm using olivere's elastic v.5 Go library (https://godoc.org/gopkg.in/olivere/elastic.v5) for my Elastic queries. If I have an elastic mapping like this:

"mappings": {
        "boxes": {
            "properties": {
                "field1": {
                    "type": "string"
                },
                "field2": {
                    "type": "string"
                },
                "field3": {
                    "type": "date"
                },
                "field4": {
                    "type": "date"
                }
            }
        }

And I want to get a list of all fields that have type 'date'.

I've looked into GetFieldMapping but that doesn't seem to have an option to filter the fields based on type.

I tried this:

elasticclient.GetFieldMapping().Index("someindex").Type("boxes").Field().Type("date").Pretty(true).Do(ctx)

That just gives me all the fields and their types. Is there a different syntax to do this? Thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试