# Search for phrases with special characters - Attachment Content

**URL:** https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797
**Category:** Elasticsearch
**Created:** [May 24, 2016, 7:47am UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797 "2016-05-24T07:47:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ASN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asn/32/10535_2.png) [@ASN](https://discuss.elastic.co/u/ASN)
#### Post date: [May 24, 2016, 7:47am UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797/1 "2016-05-24T07:47:48Z")

</div>

Hi all,

Is there any way in which i can search for phrases with special charecters in the content of the attached file? for eg: i want to search for [asn@xyz.com](mailto:asn@xyz.com) in the contents of all the indexed files.

I actually tried it on my code and it seems to be like '@' is not considered and instead it is searching for asn, xyz and com separately and generating results. How can I solve this?

TIA

---

<div class="post-metadata">

### Author: ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)
#### Post date: [May 24, 2016, 9:20am UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797/2 "2016-05-24T09:20:31Z")

</div>

Hi @ASN,

I guess you have problems with the analysis process. See [How to Index special characters and Search those special characters in Elasticsearch](https://discuss.elastic.co/t/how-to-index-special-characters-and-search-those-special-characters-in-elasticsearch/42506) for more details.

Daniel

---

<div class="post-metadata">

### Author: ![ASN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asn/32/10535_2.png) [@ASN](https://discuss.elastic.co/u/ASN)
#### Post date: [May 24, 2016, 9:53am UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797/3 "2016-05-24T09:53:51Z")

</div>

Hi @danielmitterdorfer

Thanks for the reply.

From the link you have provided, I understood that using a custom analyzer would help us solve this problem. But I have a doubt .  
Is it possible to add multiple analyzers on the same field name? Because as I'm working on attachments and for better search performance i added "english" analyzer already on the Attachment. So is it possible to add another analyzer?

something like this:

```
 var createIndexResponse =
                client.CreateIndex(defaultIndex, c => c
                .Mappings(m => m
                .Map<Document>(mp => mp
                .Properties(ps => ps
                    .Number(n => n.Name(e => e.Id))
                    .String(s => s.Name(e => e.Title))
                    .Attachment(s => s.Name(p => p.File)
                        .FileField(ff => ff.Name(f => f.File)
                        .TermVector(TermVectorOption.WithPositionsOffsetsPayloads)
                        .Analyzer("english")
                        .Store(true)))))));
```

---

<div class="post-metadata">

### Author: ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)
#### Post date: [May 24, 2016, 9:56am UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797/4 "2016-05-24T09:56:45Z")

</div>

Hi @ASN,

yes, this is possible with [multi-fields](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/multi-fields.html).

Daniel

---

<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: [July 5, 2017, 10:49pm UTC](https://discuss.elastic.co/t/search-for-phrases-with-special-characters-attachment-content/50797/5 "2017-07-05T22:49:35Z")

</div>


