# Field name alias

**URL:** <https://discuss.elastic.co/t/field-name-alias/11858>\
**Category:** Elasticsearch\
**Created:** [May 7, 2013, 3:16pm UTC](https://discuss.elastic.co/t/field-name-alias/11858 "2013-05-07T15:16:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valentin\_Pletzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valentin_pletzer/32/105548_2.png) [@Valentin\_Pletzer](https://discuss.elastic.co/u/Valentin_Pletzer)\
**Post date:** [May 7, 2013, 3:16pm UTC](https://discuss.elastic.co/t/field-name-alias/11858/1 "2013-05-07T15:16:30Z")

</div>

Hi,

is there something I would call "field name alias"? Suppose I have two  
indeces/types with two different document schemas. One where the title of  
the document is found in the field "title" and another where the field is  
called "headline". But at query time I only want to query the field-(alias)  
"title" but get both matching types of documents.

document A:  
{ "title": "hello" }

document B:  
{ "headline": "hello" }

pseudo-query:  
{  
"term" : { "titleAlias" : "hello"}  
}

Cheers

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 7, 2013, 9:43pm UTC](https://discuss.elastic.co/t/field-name-alias/11858/2 "2013-05-07T21:43:08Z")

</div>

Hey,

no real alias functionality, but you can rename fields on indexing using  
the index\_name property in your mapping.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Hope this helps

On Tue, May 7, 2013 at 5:16 PM, Valentin [pletzer@gmail.com](mailto:pletzer@gmail.com) wrote:

> Hi,
> 
> is there something I would call "field name alias"? Suppose I have two  
> indeces/types with two different document schemas. One where the title of  
> the document is found in the field "title" and another where the field is  
> called "headline". But at query time I only want to query the field-(alias)  
> "title" but get both matching types of documents.
> 
> document A:  
> { "title": "hello" }
> 
> document B:  
> { "headline": "hello" }
> 
> pseudo-query:  
> {  
> "term" : { "titleAlias" : "hello"}  
> }
> 
> Cheers
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Valentin\_Pletzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valentin_pletzer/32/105548_2.png) [@Valentin\_Pletzer](https://discuss.elastic.co/u/Valentin_Pletzer)\
**Post date:** [May 8, 2013, 6:26am UTC](https://discuss.elastic.co/t/field-name-alias/11858/3 "2013-05-08T06:26:03Z")

</div>

Thanks!

On Tuesday, May 7, 2013 11:43:08 PM UTC+2, Alexander Reelsen wrote:

> Hey,
> 
> no real alias functionality, but you can rename fields on indexing using  
> the index\_name property in your mapping.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/core-types/)
> 
> Hope this helps
> 
> On Tue, May 7, 2013 at 5:16 PM, Valentin \<[ple...@gmail.com](mailto:ple...@gmail.com) \<javascript:\>\>wrote:
> 
> > Hi,
> > 
> > is there something I would call "field name alias"? Suppose I have two  
> > indeces/types with two different document schemas. One where the title of  
> > the document is found in the field "title" and another where the field is  
> > called "headline". But at query time I only want to query the field-(alias)  
> > "title" but get both matching types of documents.
> > 
> > document A:  
> > { "title": "hello" }
> > 
> > document B:  
> > { "headline": "hello" }
> > 
> > pseudo-query:  
> > {  
> > "term" : { "titleAlias" : "hello"}  
> > }
> > 
> > Cheers
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:37am UTC](https://discuss.elastic.co/t/field-name-alias/11858/4 "2017-07-06T02:37:44Z")

</div>


