# Attachment field analyzed and not\_analyzed

**URL:** <https://discuss.elastic.co/t/attachment-field-analyzed-and-not-analyzed/63362>\
**Category:** Elasticsearch\
**Created:** [October 19, 2016, 9:18am UTC](https://discuss.elastic.co/t/attachment-field-analyzed-and-not-analyzed/63362 "2016-10-19T09:18:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerioorfano](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@valerioorfano](https://discuss.elastic.co/u/valerioorfano)\
**Post date:** [October 19, 2016, 9:18am UTC](https://discuss.elastic.co/t/attachment-field-analyzed-and-not-analyzed/63362/1 "2016-10-19T09:18:16Z")

</div>

Hi There, i need to use attachment field as both analyzed and not\_analyzed fields.

I've tried the following configuration but it doesn't work.

```
                 "claims_IT": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "analyzer": "italian"
                                },
                            "raw": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "index": "not_analyzed"
                                }
                            }
                 }

```

But i get an error raw:string is not allowed!

Then i thought this as possible solution. Is that fine?

```
                 "claims_IT": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "analyzer": "italian"
                                }
                            }
                 },
                "claims_IT_raw": {
                    "type": "attachment",
                        "fields": {
                            "content": {
                                "type": "string",
                                "term_vector":"with_positions_offsets",
                                "index": "not_analyzed"
                                }
                            }
                 },

```

Thanx valerio

---

<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:11pm UTC](https://discuss.elastic.co/t/attachment-field-analyzed-and-not-analyzed/63362/2 "2017-07-05T22:11:21Z")

</div>


