Not all fields appear in controls visualization

Hi all, I was trying to use controls visualization with case-insensitive search available for the inputs. So, I ran the following query to set the mapping for the index.

PUT log_server_db_march
{
  "settings":{
    "index":{
      "number_of_shards" : 3, 
      "number_of_replicas" : 2,
      "analysis":{
        "analyzer":{
          "analyzer_case_insensitive":{
            "tokenizer":"keyword",
            "filter":"lowercase"
          }
        }
      }
    }
  },
  "mappings":{
      "properties":{
        "feature_name":{
          "type":"text",
          "analyzer":"analyzer_case_insensitive"
        },
	"dut_type":{
	"type":"text",
	"analyzer":"analyzer_case_insensitive"
	},
	"tc_name":{
	"type":"text",
	"analyzer":"analyzer_case_insensitive"
	}      
}
}
}

But, after importing all the data, when I tried creating control visualization, I could not see the fields for which I applied the case-insensitive filter in the list. Is it because of the fact that I've declared the type of these three fields as text? Because I could see all other fields with numeric and string type.

If not, then how is it possible to get to select these three fields there in the list?
For more clearance, I'm talking about the field list in the snapshot.

hi @Jaishree_Pal, as per documentation

Options list — Filters content based on one or more specified options. The dropdown menu is dynamically populated with the results of a terms aggregation. For example, use the options list on the sample flight dashboard when you want to filter the data by origin city and destination city.

Since your fields are not keyword type, they cannot be used for aggregations. You can confirm that in your index pattern inspecting if your fields are marked as Aggregatable.

The solution then is to use keyword fields in your mapping, and for that instead of an analyzer you need to use a normalizer.

I've recreated your set up and you can check how the values for the field test 1 are all in lowercase in the Controls visualization.

PUT test_tokenizer
{
  "settings": {
    "index": {
      "number_of_shards": 1,
      "number_of_replicas": 1,
      "analysis": {
        "normalizer": {
          "normalizer_case_insensitive": {
            "type": "custom",
            "filter": ["lowercase"]
          }
      }
      }
    }
  },
  "mappings": {
    "properties": {
      "test1": {
        "type": "keyword",
        "normalizer": "normalizer_case_insensitive"
      },
      "test2": {
        "type": "float"
      },
      "test3": {
        "type": "text"
      },
      "test4": {
        "type": "boolean"
      }
    }
  }
}

POST /_bulk
{ "index" : { "_index" : "test_tokenizer", "_id" : "1" } }
{ "test1" : "VALUE 1", "test2" : 1, "test3" : "Key 1", "test4": true }
{ "index" : { "_index" : "test_tokenizer", "_id" : "2" } }
{ "test1" : "value 2", "test2" : 2, "test3" : "Key 1", "test4": true }
{ "index" : { "_index" : "test_tokenizer", "_id" : "3" } }
{ "test1" : "Value 3", "test2" : 3, "test3" : "Key 2", "test4": false }
{ "index" : { "_index" : "test_tokenizer", "_id" : "4" } }
{ "test1" : "Value 4", "test2" : 4, "test3" : "Key 2", "test4": true }
{ "index" : { "_index" : "test_tokenizer", "_id" : "5" } }
{ "test1" : "ValuE 5", "test2" : 5, "test3" : "Key 2", "test4": false }

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