# Issue in searching by \_type in visualize tab

**URL:** <https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563>\
**Category:** Kibana\
**Created:** [January 9, 2019, 3:20pm UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563 "2019-01-09T15:20:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alf\_sender](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alf_sender/32/39609_2.png) [@alf\_sender](https://discuss.elastic.co/u/alf_sender)\
**Post date:** [January 9, 2019, 3:20pm UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563/1 "2019-01-09T15:20:23Z")

</div>

Hi,

I am having trouble using "\_type" field in Kibana visualize tab. Basically I have below mapping configured.

```
{
	"aliases": {},
	"mappings": {
		"process-instance-activities": {
			"_meta": {
				"_version": "1.4.0"
			},
			"properties": {
				"activityId": {
					"type": "keyword"
				},
				"activityName": {
					"type": "text",
					"fields": {
						"_exact_name": {
							"type": "keyword"
						}
					}
				},
				"activityType": {
					"type": "keyword"
				},
				"behaviorClass": {
					"type": "keyword"
				},
				"duration": {
					"type": "long"
				},
				"endTime": {
					"type": "date"
				},
				"executionId": {
					"type": "keyword"
				},
				"historicActivityEntityId": {
					"type": "keyword"
				},
				"processDefinitionId": {
					"type": "keyword"
				},
				"processDefinitionKey": {
					"type": "keyword"
				},
				"processInstanceId": {
					"type": "keyword"
				},
				"startTime": {
					"type": "date"
				},
				"tenantId": {
					"type": "keyword"
				},
				"timeStamp": {
					"type": "date"
				},
				"userId": {
					"type": "keyword"
				}
			}
		},
		"completed-tasks": {
			"_meta": {
				"_version": "1.4.0"
			},
			"properties": {
				"assignee": {
					"type": "keyword"
				},
				"category": {
					"type": "keyword"
				},
				"createTime": {
					"type": "date"
				},
				"description": {
					"type": "text"
				},
				"dueDate": {
					"type": "date"
				},
				"duration": {
					"type": "long"
				},
				"executionId": {
					"type": "keyword"
				},
				"formKey": {
					"type": "keyword"
				},
				"id": {
					"type": "keyword"
				},
				"name": {
					"type": "text",
					"fields": {
						"_exact_name": {
							"type": "keyword"
						}
					}
				},
				"owner": {
					"type": "keyword"
				},
				"priority": {
					"type": "integer"
				},
				"processDefinitionId": {
					"type": "keyword"
				},
				"processDefinitionKey": {
					"type": "keyword"
				},
				"processInstanceId": {
					"type": "keyword"
				},
				"taskDefinitionKey": {
					"type": "keyword"
				},
				"tenantId": {
					"type": "keyword"
				},
				"timeStamp": {
					"type": "date"
				}
			}
		},
		"variables": {
			"_meta": {
				"_version": "1.4.0"
			},
			"properties": {
				"booleanValue": {
					"type": "boolean"
				},
				"createTime": {
					"type": "date"
				},
				"dateValue": {
					"type": "date"
				},
				"doubleValue": {
					"type": "double"
				},
				"executionId": {
					"type": "keyword"
				},
				"integerValue": {
					"type": "integer"
				},
				"json": {
					"type": "keyword"
				},
				"longValue": {
					"type": "long"
				},
				"name": {
					"type": "text",
					"fields": {
						"_exact_name": {
							"type": "keyword"
						}
					}
				},
				"processDefinitionId": {
					"type": "keyword"
				},
				"processDefinitionKey": {
					"type": "keyword"
				},
				"processInstanceId": {
					"type": "keyword"
				},
				"shortValue": {
					"type": "short"
				},
				"stringValue": {
					"type": "text",
					"fields": {
						"_exact_string_value": {
							"type": "keyword"
						}
					}
				},
				"taskId": {
					"type": "keyword"
				},
				"tenantId": {
					"type": "keyword"
				},
				"timeStamp": {
					"type": "date"
				},
				"userId": {
					"type": "keyword"
				},
				"uuidValue": {
					"type": "keyword"
				},
				"variableType": {
					"type": "keyword"
				}
			}
		},
		"process-instances": {
			"_meta": {
				"_version": "1.4.0"
			},
			"properties": {
				"businessKey": {
					"type": "keyword"
				},
				"createTime": {
					"type": "date"
				},
				"duration": {
					"type": "long"
				},
				"endTime": {
					"type": "date"
				},
				"id": {
					"type": "keyword"
				},
				"name": {
					"type": "text",
					"fields": {
						"_exact_name": {
							"type": "keyword"
						}
					}
				},
				"processDefinitionId": {
					"type": "keyword"
				},
				"processDefinitionKey": {
					"type": "keyword"
				},
				"tenantId": {
					"type": "keyword"
				},
				"timeStamp": {
					"type": "date"
				},
				"userId": {
					"type": "keyword"
				}
			}
		}
	},
	"settings": {
		"index": {
			"creation_date": "1544500290297",
			"number_of_shards": "5",
			"number_of_replicas": "1",
			"uuid": "2OH2298nQsWzguXMjSlpag",
			"version": {
				"created": "5060099"
			},
			"provided_name": "activiti_tenant_1"
		}
	}
}

```

From Kibana when I try to run query as "\_type: process-instances" I am seeing results as shown below.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a9ec388e694a14f2e3a9314eab806ee8d4b72f14.png)

But when I run query as "\_type: process-instance-activities", I am not seeing any results.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/5/65b31d52e532e5cd5a1ace6af5f6cd76a438ee4b.png)

Other thing which I noticed on visualize tab is when I don't have any search criteria applied, I am not seeing "process-instance-activities" under "\_type" field.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad37726fb42295a1d16d406d33da869d6b773c78.png)

Also, when I execute direct Elasticsearch API "localhost:9200/activiti\_tenant\_1/ **process-instance-activities** /\_search?size=100" I am able to see json response with correct data.

Question here is though data is present under mapping why am I not able to search same from Kibana and use that to generate custom visualization.

Looking forward to your inputs, thank you in Advance.

_Environment Details_:  
**Elasticsearch** : 5.6.0  
**Kibana** : 5.6.0

Regards.

---

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [January 9, 2019, 5:42pm UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563/2 "2019-01-09T17:42:45Z")

</div>

Hello Alf,

The hyphen is a reserved character in lucene query syntax, so you'd need to escape each usage with a backslash. See [this page](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/query-dsl-query-string-query.html#_reserved_characters) for guidance.

Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![alf\_sender](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alf_sender/32/39609_2.png) [@alf\_sender](https://discuss.elastic.co/u/alf_sender)\
**Post date:** [January 10, 2019, 12:29am UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563/3 "2019-01-10T00:29:20Z")

</div>

Hi Aaron,

Thank you for response. I tried escaping '-' hyphen as you suggested but I am still not able to get data. Please see my below query:  
` **_type:process\-instance\-activities** `

Under same index I have other mapping (refer json shared in main ticket) which also has '-' hyphen in "\_type" property, but I am able to search without escaping hyphen. see below query...  
` **type:process-instances** `

Regards.

---

<div class="post-metadata">

**Author:** ![alf\_sender](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alf_sender/32/39609_2.png) [@alf\_sender](https://discuss.elastic.co/u/alf_sender)\
**Post date:** [January 12, 2019, 10:28pm UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563/4 "2019-01-12T22:28:36Z")

</div>

Hi,

Other thing which I wanted to share here is, when I try to search for same mapping from Kibana \> Dev Tools, I am able to search and get results. Please refer below screenshot.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5f1a4be9a5fc689632adab86657b14cd541cf762.png)

Still I am not sure how Do i search for "process-instance-activities" \_type from Kibana **Discover**? Any inputs is really appreciated.

Also, when I navigate to Kibana \> Discover page without any search criteria, I see "\_type" is present under "Available fields". But when I click on that field, it shows me only 3 mapping values (ie...1: process-instances, completed-tasks, variables). Not sure what is going on behind the scene. I was expecting to see all 4 mappings under this field.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/8/48bbeae11d2d47d0334d4391cb17a78f82735007.png)

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 9, 2019, 10:28pm UTC](https://discuss.elastic.co/t/issue-in-searching-by-type-in-visualize-tab/163563/5 "2019-02-09T22:28:39Z")

</div>

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