# My search term has reserved characters, and I need to perform a wildcard search

**URL:** <https://discuss.elastic.co/t/my-search-term-has-reserved-characters-and-i-need-to-perform-a-wildcard-search/344943>\
**Category:** Elasticsearch\
**Created:** [October 12, 2023, 4:39pm UTC](https://discuss.elastic.co/t/my-search-term-has-reserved-characters-and-i-need-to-perform-a-wildcard-search/344943 "2023-10-12T16:39:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NandhiniD](https://avatars.discourse-cdn.com/v4/letter/n/e9c0ed/32.png) [@NandhiniD](https://discuss.elastic.co/u/NandhiniD)\
**Post date:** [October 12, 2023, 4:39pm UTC](https://discuss.elastic.co/t/my-search-term-has-reserved-characters-and-i-need-to-perform-a-wildcard-search/344943/1 "2023-10-12T16:39:31Z")

</div>

Hi,

I'm trying to search for multiple terms containing special characters using wildcards. To do this, I've employed the query string with the AND operator and multiple terms.

When I exclusively use the code below, wildcards (\*) and the AND operator function correctly, but the search for special characters doesn't work:

```auto
.DefaultOperator(Operator.And)
.AnalyzeWildcard(true)
.Query(string.Join(" ", finalkeyword.Select(Key => $"*{Key}*")))

```

Conversely, when I only use the code below using the escape, the search for special characters functions properly, but wildcards (\*) and the AND operator do not work:

```auto
.DefaultOperator(Operator.And) 
.Escape(true) 
.Query(string.Join(" ", finalkeyword.Select(Key =&gt; $"*{Key}*")))

```

My requirement was to use either multiple search terms or a single term. I wanted to employ the 'AND' operator along with a special character to conduct a wildcard search.

For Example search term :  
"International" - Expected multiple results  
" International doctor" - Expected multiple results  
" International doctor day"- Expected multiple results  
"International doctor day 05/30/2023" - Expected 1 results  
"05/30/2023" - Expected multiple results  
"Internat doct da 05/30/2023" - Expected multiple results

---

<div class="post-metadata">

**Author:** ![NandhiniD](https://avatars.discourse-cdn.com/v4/letter/n/e9c0ed/32.png) [@NandhiniD](https://discuss.elastic.co/u/NandhiniD)\
**Post date:** [October 24, 2023, 2:51pm UTC](https://discuss.elastic.co/t/my-search-term-has-reserved-characters-and-i-need-to-perform-a-wildcard-search/344943/2 "2023-10-24T14:51:20Z")

</div>

Hi,

I would appreciate any suggestions and assistance you may provide.

---

<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:** [November 21, 2023, 2:51pm UTC](https://discuss.elastic.co/t/my-search-term-has-reserved-characters-and-i-need-to-perform-a-wildcard-search/344943/3 "2023-11-21T14:51:56Z")

</div>

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