# How to treat sorting for string fields as not\_analyzed

**URL:** <https://discuss.elastic.co/t/how-to-treat-sorting-for-string-fields-as-not-analyzed/22933>\
**Category:** Elasticsearch\
**Created:** [March 26, 2015, 8:10pm UTC](https://discuss.elastic.co/t/how-to-treat-sorting-for-string-fields-as-not-analyzed/22933 "2015-03-26T20:10:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [March 26, 2015, 8:10pm UTC](https://discuss.elastic.co/t/how-to-treat-sorting-for-string-fields-as-not-analyzed/22933/1 "2015-03-26T20:10:48Z")

</div>

Only when performing a sort operation, I would like to treat a string field  
like  
{name: "first last"}

as not\_analyzed ... is this possible?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 29, 2015, 8:39pm UTC](https://discuss.elastic.co/t/how-to-treat-sorting-for-string-fields-as-not-analyzed/22933/2 "2015-03-29T20:39:30Z")

</div>

It is not possible. The common solution to this kind of issues is to index  
the field twice: once analyzed and once not\_analyzed. You can do it with  
multi fields

> **[fields | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html)**

On Thu, Mar 26, 2015 at 9:10 PM, pulkitsinghal [pulkitsinghal@gmail.com](mailto:pulkitsinghal@gmail.com)  
wrote:

> Only when performing a sort operation, I would like to treat a string  
> field like  
> {name: "first last"}
> 
> as not\_analyzed ... is this possible?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b02b4a7b-7505-4a30-be81-c727898c18b3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAiRV2uhw%2B-8PTrJL1m40QA%3DLZYxeJgT45ALe%2BDbw77VzA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAiRV2uhw%2B-8PTrJL1m40QA%3DLZYxeJgT45ALe%2BDbw77VzA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:23am UTC](https://discuss.elastic.co/t/how-to-treat-sorting-for-string-fields-as-not-analyzed/22933/3 "2017-07-06T00:23:10Z")

</div>


