# Raw vs full text search

**URL:** <https://discuss.elastic.co/t/raw-vs-full-text-search/26486>\
**Category:** Elasticsearch\
**Created:** [July 29, 2015, 1:21pm UTC](https://discuss.elastic.co/t/raw-vs-full-text-search/26486 "2015-07-29T13:21:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cching](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cching/32/44800_2.png) [@cching](https://discuss.elastic.co/u/cching)\
**Post date:** [July 29, 2015, 1:21pm UTC](https://discuss.elastic.co/t/raw-vs-full-text-search/26486/1 "2015-07-29T13:21:06Z")

</div>

I need to have a field be searchable using both full text and exact match searches. I've been creating a separate field doing something like "name" and "name\_raw", but reading the documentation I see that collapsed fields look like a nice way to resolve this, e.g.:

```
{
    "properties": {
        "user": {
            "properties": {
                "name": { 
                    "type": "string",
                    "fields": {
                        "raw": { 
                            "type": "string",
                            "index": "not_analyzed"
                        }
                    }
                }
            }
        }
    }
}

```

Would that be considered a best practice? Is there any reason not to do this?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 29, 2015, 1:26pm UTC](https://discuss.elastic.co/t/raw-vs-full-text-search/26486/2 "2015-07-29T13:26:44Z")

</div>

Yep, the above ([multi-fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-core-types.html#_multi_fields_3)) would be the preferred way to do this 🙂

---

<div class="post-metadata">

**Author:** ![cching](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cching/32/44800_2.png) [@cching](https://discuss.elastic.co/u/cching)\
**Post date:** [July 29, 2015, 1:36pm UTC](https://discuss.elastic.co/t/raw-vs-full-text-search/26486/3 "2015-07-29T13:36:05Z")

</div>

Awesome! Thanks Colin!

---

<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, 11:58pm UTC](https://discuss.elastic.co/t/raw-vs-full-text-search/26486/4 "2017-07-05T23:58:21Z")

</div>


