Not_analyzed field being analyzed

I have the following mapping:

PUT /metrics
"mappings": {
"metric": {
"properties": {
"Activated": {
"type": "string",
"index":"not_analyzed"
},
"Activation Status": {
"type": "string",
"index":"not_analyzed"
},
"Activation Time Flag": {
"type": "string",
"index":"not_analyzed"
},
"Associate": {
"type": "string",
"index":"not_analyzed"
},
"Carrier": {
"type": "string",
"index":"not_analyzed"
},
"Date Activated": {
"type": "date",
"format": "dateOptionalTime"
}
}
}

I create the index with this mapping and then use Logstash to import some data from SQL Server. However when reviewing the imported data in Kibana the string fields are being marked as analyzed and the visualizations I create using them have the data in the field broken apart.

I am at a loss as to how to get the string fields to not be analyzed. Any help would be very appreciated.

Any way to get an example of manually putting a document with these fields? Can you see how logstash is indexing?

Have you tried reloading the mapping from Kibana? Go to Settings, select the index pattern, then click on the Reload icon. And see if that helps.

Thanks for the responses and suggestions. As it turns out the command I was using to set up the index and mapping was not correct. So the index was created and no error was thrown but no actual mapping was created. When I then imported data into the index the data was auto mapped. Once I got the command correct it worked as expected.

Hi ,can you tell me what was incorrect in your mapping ? Because I am facing the exact same problem and cant seem to find a way around it.

Thanks !

It was a while ago so I am not exactly sure what was the problem but in looking at it now it seems like I was missing curly braces (in bold in the example below) after the name of the index. I think what helped the most was to install the Sense Chrome plug-in. It helped with validating the json.

put /strlvlmetrics
{
"mappings": {
"metric": {
"properties": {
"partnerorderid": {
"type": "long"
},
"partnerid": {
"type": "long"
},
"store state": {
"type": "string",
"index": "not_analyzed"
},
"store city": {
"type": "string",
"index": "not_analyzed"
},
"orderitem_id": {
"type": "long"
},
"equipment name": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}