# Search data with special characters

**URL:** <https://discuss.elastic.co/t/search-data-with-special-characters/360285>\
**Category:** Elasticsearch\
**Created:** [May 27, 2024, 11:53am UTC](https://discuss.elastic.co/t/search-data-with-special-characters/360285 "2024-05-27T11:53:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Cuesta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrian_cuesta/32/134836_2.png) [@Adrian\_Cuesta](https://discuss.elastic.co/u/Adrian_Cuesta)\
**Post date:** [May 27, 2024, 11:53am UTC](https://discuss.elastic.co/t/search-data-with-special-characters/360285/1 "2024-05-27T11:53:35Z")

</div>

Hi! I have a problem with getting data with special characters like -,+,% i have and index and my fields are like this:

```auto
"productSacCode": {
			"type": "text"
		}
"productShortDescription": {
			"fielddata": true,
			"type": "text",
			"fields": {
				"keyword": {
					"ignore_above": 256,
					"type": "keyword"
				}
			}
		}
"productSac": {
			"type": "nested",
			"properties": {
				"productSacDescription": {
					"fielddata": true,
					"type": "text",
					"fields": {
						"keyword": {
							"ignore_above": 256,
							"type": "keyword"
						}
					}
				},
				"productSacCode": {
					"fielddata": true,
					"type": "text",
					"fields": {
						"keyword": {
							"ignore_above": 256,
							"type": "keyword"
						}
					}
				}
			}
		}

```

i'd tried on these 2 type of fields using must and should with various queries like nested queries, wildcardqueries, etc...  
Anyone know the way to searhc with special characters? i tried to scape the special characters but doesn't work

thanks in advance

---

<div class="post-metadata">

**Author:** ![Sajad\_Soltanian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sajad_soltanian/32/122022_2.png) [@Sajad\_Soltanian](https://discuss.elastic.co/u/Sajad_Soltanian)\
**Post date:** [May 27, 2024, 11:07pm UTC](https://discuss.elastic.co/t/search-data-with-special-characters/360285/2 "2024-05-27T23:07:27Z")

</div>

could you please provide some document sample and the search result you expect for an specific search?

- document
- query
- expected result

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [May 28, 2024, 12:26pm UTC](https://discuss.elastic.co/t/search-data-with-special-characters/360285/3 "2024-05-28T12:26:44Z")

</div>

Have you looked into creating a [custom analyzer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html) that handles your specific needs?

---

<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:** [June 25, 2024, 12:27pm UTC](https://discuss.elastic.co/t/search-data-with-special-characters/360285/4 "2024-06-25T12:27:15Z")

</div>

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