# Search and partial search using or not special characters

**URL:** <https://discuss.elastic.co/t/search-and-partial-search-using-or-not-special-characters/316655>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [October 14, 2022, 3:43pm UTC](https://discuss.elastic.co/t/search-and-partial-search-using-or-not-special-characters/316655 "2022-10-14T15:43:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kqgcm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kqgcm/32/101333_2.png) [@kqgcm](https://discuss.elastic.co/u/kqgcm)\
**Post date:** [October 14, 2022, 3:43pm UTC](https://discuss.elastic.co/t/search-and-partial-search-using-or-not-special-characters/316655/1 "2022-10-14T15:43:40Z")

</div>

Hello,

I have something like this:

```auto
"documents" : {
            "type1" : "341.943-61",
            "type2" : "5.6-0"
          }

```

But the user is not require to input it with special characters, so, it can be something like this:

```auto
"documents" : {
            "type1" : "34194361",
            "type2" : "560"
          }

```

So now, I need to be able to retrieve both results, if the user input something like:

```auto
documents.type1 = 34194361

```

Or partial, like:

```auto
documents.type1 = 4194

```

I tried:

```auto
GET myBase/_search
{
  "from":0,
  "size":10,
  "query": {
    "term": {
      "documents.type1.raw": "34194361"
      
    }
  }
}

```

But it didn't work, it returns nothing. The exact search I'm able to retrieve using "keyword" in kibana.

I get the same results using Nest (.Net)  
(field would be the documents.type1 and value would be 34194361)

```auto
var searchResponse = await _elasticContext.Client.SearchAsync<Customer>(s => s
                                                                  .From(skip)
                                                                  .Size(limit)
                                                                  .Query(qu => qu
                                                                        .MultiMatch(mm => mm
                                                                            .Fields(f => f
                                                                                .Field(field))
                                                                            .Query($"{value.Trim()}")
                                                                            .Type(TextQueryType.BoolPrefix))
                                                                    ));

```

Thank you for the help.

---

<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 11, 2022, 3:43pm UTC](https://discuss.elastic.co/t/search-and-partial-search-using-or-not-special-characters/316655/2 "2022-11-11T15:43:42Z")

</div>

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