Kibana 5.2, How to set "searchable" or "aggregatable"

Hi, I'm using Elasticsearch 5.2 and Kibana 5.2 on macOS 10.12.3.

After the mapping api as below on kibana console on developping Tools menu,
searchable and aggregatable menus on any field on this index wont be checked.

PUT test
{
  "mappings": {
    "logs": {
      "_source": {
        "enabled": true
      },
      "_all": {
        "enabled": true
      },
      "properties": {
        "id": {
          "type": "integer"
        },
        "timestamp": {
          "type":   "date"
        },
        "customer_id": {
          "type": "integer"
        },
        "customer_name": {
          "type": "string",
          "index": "not_analyzed"
        },
        "description": { 
          "type": "string",
          "index": "analyzed"
        }
      }
    }
  }
}

How can I set searchable and aggregatable on these fields to yes?

  • when I input the data to elastic search without mappings, searchable/aggregatable on these fields are checked. what the difference,,,. I'm not make sense.

It's those.
However you should switch to the keyword data type.

1 Like

thanks! but these fields (id, timestamp) are also not searchable.
do these fields also need to change keyword for searchable??

Thanks, warkolm.
I changed the mappings as below.

{
  "mappings": {
    "logs": {
      "_source": {
        "enabled": true
      },
      "_all": {
        "enabled": true
      },
      "properties": {
        "id": {
          "type": "integer"
        },
        "timestamp": {
          "type":   "date"
        },
        "customer_id": {
          "type": "integer"
        },
        "customer_name": {
          "type": "keyword"
        },
        "description": { 
          "type": "string",
          "index": "analyzed"
        }
      }
    }
  }
}

but situation is not changed. Kibana still cannot set the status to searchable.

In case, I cannot use the non-searchable field in dashboards.

Any idea?

What I observed in the past is that none of the fields are marked searchable until there's some data in the index. Also, once the data is inserted, make sure you refresh your index.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.