# Facet on non-existent field throws error

**URL:** https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501
**Category:** Elasticsearch
**Created:** [June 21, 2013, 2:02am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501 "2013-06-21T02:02:26Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)
#### Post date: [June 21, 2013, 2:02am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/1 "2013-06-21T02:02:26Z")

</div>

Normally, my index has documents with a particular field, so facet requests on that field succeeds. But this time, if the index is empty, the facet request fails and complains that the field doesn't exist.

Is there a way to have facets safely return empty result if no such field exists? Similar to how sorting has "ignore\_unmapped". Need this especially in cases where indexes are rolling, and we don't know ahead of time if an index is empty or not before it is searched.

Thanks,  
-Vinh

--  
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: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 23, 2013, 12:47am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/2 "2013-06-23T00:47:37Z")

</div>

I posted a duplicate question just a few days ago, awaiting response also:

Hi all,

When doing a faceted filter/query where the facet term doesn't exist in any  
document, is it possible for elasticsearch to return an empty facet result,  
rather than throw an exception?

If this isn't possible, would it be reasonable to add an option to the API  
to turn this functionality on?

Thanks

On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Normally, my index has documents with a particular field, so facet  
> requests on that field succeeds. But this time, if the index is empty, the  
> facet request fails and complains that the field doesn't exist.
> 
> Is there a way to have facets safely return empty result if no such field  
> exists? Similar to how sorting has "ignore\_unmapped". Need this  
> especially in cases where indexes are rolling, and we don't know ahead of  
> time if an index is empty or not before it is searched.
> 
> Thanks,  
> -Vinh
> 
> --  
> 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: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 23, 2013, 4:06am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/3 "2013-06-23T04:06:29Z")

</div>

What happens if you put a mapping for your type in the same time you create your new index?

Could this solve your issue?

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :

I posted a duplicate question just a few days ago, awaiting response also:

Hi all,

When doing a faceted filter/query where the facet term doesn't exist in any document, is it possible for elasticsearch to return an empty facet result, rather than throw an exception?

If this isn't possible, would it be reasonable to add an option to the API to turn this functionality on?

Thanks

On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Normally, my index has documents with a particular field, so facet requests on that field succeeds. But this time, if the index is empty, the facet request fails and complains that the field doesn't exist.
> 
> Is there a way to have facets safely return empty result if no such field exists? Similar to how sorting has "ignore\_unmapped". Need this especially in cases where indexes are rolling, and we don't know ahead of time if an index is empty or not before it is searched.
> 
> Thanks,  
> -Vinh
> 
> --  
> 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).

--  
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: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 23, 2013, 11:41pm UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/4 "2013-06-23T23:41:44Z")

</div>

Hi David,

I don't know ahead of time what fields are going to exist in the index, so  
no.

Thanks  
A

On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> What happens if you put a mapping for your type in the same time you  
> create your new index?
> 
> Could this solve your issue?
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> 
> I posted a duplicate question just a few days ago, awaiting response also:
> 
> Hi all,
> 
> When doing a faceted filter/query where the facet term doesn't exist in  
> any document, is it possible for elasticsearch to return an empty facet  
> result, rather than throw an exception?
> 
> If this isn't possible, would it be reasonable to add an option to the API  
> to turn this functionality on?
> 
> Thanks
> 
> On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> 
> > Normally, my index has documents with a particular field, so facet  
> > requests on that field succeeds. But this time, if the index is empty, the  
> > facet request fails and complains that the field doesn't exist.
> > 
> > Is there a way to have facets safely return empty result if no such field  
> > exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > especially in cases where indexes are rolling, and we don't know ahead of  
> > time if an index is empty or not before it is searched.
> > 
> > Thanks,  
> > -Vinh
> > 
> > --  
> > 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).
> 
> --  
> 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: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 24, 2013, 2:18am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/5 "2013-06-24T02:18:23Z")

</div>

How can you ask for a facet on fields you don't know?  
I think I missed something here.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :

Hi David,

I don't know ahead of time what fields are going to exist in the index, so no.

Thanks  
A

On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> What happens if you put a mapping for your type in the same time you create your new index?
> 
> Could this solve your issue?
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> 
> I posted a duplicate question just a few days ago, awaiting response also:
> 
> Hi all,
> 
> When doing a faceted filter/query where the facet term doesn't exist in any document, is it possible for elasticsearch to return an empty facet result, rather than throw an exception?
> 
> If this isn't possible, would it be reasonable to add an option to the API to turn this functionality on?
> 
> Thanks
> 
> On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> 
> > Normally, my index has documents with a particular field, so facet requests on that field succeeds. But this time, if the index is empty, the facet request fails and complains that the field doesn't exist.
> > 
> > Is there a way to have facets safely return empty result if no such field exists? Similar to how sorting has "ignore\_unmapped". Need this especially in cases where indexes are rolling, and we don't know ahead of time if an index is empty or not before it is searched.
> > 
> > Thanks,  
> > -Vinh
> > 
> > --  
> > 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).
> 
> --  
> 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).

--  
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: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 24, 2013, 2:39am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/6 "2013-06-24T02:39:48Z")

</div>

ES is throwing an exception when a mapping doesn't exist for the field I'm  
faceting on. To fix this, I have to manually check for the mapping first,  
then return an empty result if the mapping is missing.

However, when I do a search on a nonexistent field, I just get back an  
empty result set - no exception occurs. Isn't this inconsistent?

A

On Mon, Jun 24, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> How can you ask for a facet on fields you don't know?  
> I think I missed something here.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> 
> Hi David,
> 
> I don't know ahead of time what fields are going to exist in the index, so  
> no.
> 
> Thanks  
> A
> 
> On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > What happens if you put a mapping for your type in the same time you  
> > create your new index?
> > 
> > Could this solve your issue?
> > 
> > ## HTH
> > 
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > 
> > I posted a duplicate question just a few days ago, awaiting response also:
> > 
> > Hi all,
> > 
> > When doing a faceted filter/query where the facet term doesn't exist in  
> > any document, is it possible for elasticsearch to return an empty facet  
> > result, rather than throw an exception?
> > 
> > If this isn't possible, would it be reasonable to add an option to the  
> > API to turn this functionality on?
> > 
> > Thanks
> > 
> > On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > 
> > > Normally, my index has documents with a particular field, so facet  
> > > requests on that field succeeds. But this time, if the index is empty, the  
> > > facet request fails and complains that the field doesn't exist.
> > > 
> > > Is there a way to have facets safely return empty result if no such  
> > > field exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > > especially in cases where indexes are rolling, and we don't know ahead of  
> > > time if an index is empty or not before it is searched.
> > > 
> > > Thanks,  
> > > -Vinh
> > > 
> > > --  
> > > 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).
> > 
> > --  
> > 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).
> 
> --  
> 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: ![mattweber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattweber/32/44940_2.png) [@mattweber](https://discuss.elastic.co/u/mattweber)
#### Post date: [June 24, 2013, 3:20am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/7 "2013-06-24T03:20:52Z")

</div>

I believe you can set "ignore\_unmapped" to true as of 0.90.1. If not, it  
will definitely be in the next release.

[https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1](https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1)

So something like this should work:

"myfacet": {  
"terms": {  
"field": "an\_unmapped\_field",  
"ignore\_unmapped": true  
}  
}

Hope this helps.

Thanks,  
Matt Weber

On Sun, Jun 23, 2013 at 7:39 PM, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) wrote:

> ES is throwing an exception when a mapping doesn't exist for the field I'm  
> faceting on. To fix this, I have to manually check for the mapping first,  
> then return an empty result if the mapping is missing.
> 
> However, when I do a search on a nonexistent field, I just get back an  
> empty result set - no exception occurs. Isn't this inconsistent?
> 
> A
> 
> On Mon, Jun 24, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > How can you ask for a facet on fields you don't know?  
> > I think I missed something here.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > 
> > Hi David,
> > 
> > I don't know ahead of time what fields are going to exist in the index,  
> > so no.
> > 
> > Thanks  
> > A
> > 
> > On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > What happens if you put a mapping for your type in the same time you  
> > > create your new index?
> > > 
> > > Could this solve your issue?
> > > 
> > > ## HTH
> > > 
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > 
> > > I posted a duplicate question just a few days ago, awaiting response  
> > > also:
> > > 
> > > Hi all,
> > > 
> > > When doing a faceted filter/query where the facet term doesn't exist in  
> > > any document, is it possible for elasticsearch to return an empty facet  
> > > result, rather than throw an exception?
> > > 
> > > If this isn't possible, would it be reasonable to add an option to the  
> > > API to turn this functionality on?
> > > 
> > > Thanks
> > > 
> > > On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > 
> > > > Normally, my index has documents with a particular field, so facet  
> > > > requests on that field succeeds. But this time, if the index is empty, the  
> > > > facet request fails and complains that the field doesn't exist.
> > > > 
> > > > Is there a way to have facets safely return empty result if no such  
> > > > field exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > > > especially in cases where indexes are rolling, and we don't know ahead of  
> > > > time if an index is empty or not before it is searched.
> > > > 
> > > > Thanks,  
> > > > -Vinh
> > > > 
> > > > --  
> > > > 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).
> > > 
> > > --  
> > > 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).
> > 
> > --  
> > 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).

--  
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: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 24, 2013, 4:12am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/8 "2013-06-24T04:12:54Z")

</div>

Thanks Matt, exactly what I was after. That doesn't appear to be in 0.90.0,  
I'll try 0.90.1 soon.

A

On Mon, Jun 24, 2013 at 1:20 PM, Matt Weber [matt.weber@gmail.com](mailto:matt.weber@gmail.com) wrote:

> I believe you can set "ignore\_unmapped" to true as of 0.90.1. If not, it  
> will definitely be in the next release.
> 
> [https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1](https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1)
> 
> So something like this should work:
> 
> "myfacet": {  
> "terms": {  
> "field": "an\_unmapped\_field",  
> "ignore\_unmapped": true  
> }  
> }
> 
> Hope this helps.
> 
> Thanks,  
> Matt Weber
> 
> On Sun, Jun 23, 2013 at 7:39 PM, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) wrote:
> 
> > ES is throwing an exception when a mapping doesn't exist for the field  
> > I'm faceting on. To fix this, I have to manually check for the mapping  
> > first, then return an empty result if the mapping is missing.
> > 
> > However, when I do a search on a nonexistent field, I just get back an  
> > empty result set - no exception occurs. Isn't this inconsistent?
> > 
> > A
> > 
> > On Mon, Jun 24, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > How can you ask for a facet on fields you don't know?  
> > > I think I missed something here.
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > 
> > > Hi David,
> > > 
> > > I don't know ahead of time what fields are going to exist in the index,  
> > > so no.
> > > 
> > > Thanks  
> > > A
> > > 
> > > On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > 
> > > > What happens if you put a mapping for your type in the same time you  
> > > > create your new index?
> > > > 
> > > > Could this solve your issue?
> > > > 
> > > > ## HTH
> > > > 
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > > 
> > > > I posted a duplicate question just a few days ago, awaiting response  
> > > > also:
> > > > 
> > > > Hi all,
> > > > 
> > > > When doing a faceted filter/query where the facet term doesn't exist in  
> > > > any document, is it possible for elasticsearch to return an empty facet  
> > > > result, rather than throw an exception?
> > > > 
> > > > If this isn't possible, would it be reasonable to add an option to the  
> > > > API to turn this functionality on?
> > > > 
> > > > Thanks
> > > > 
> > > > On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > > 
> > > > > Normally, my index has documents with a particular field, so facet  
> > > > > requests on that field succeeds. But this time, if the index is empty, the  
> > > > > facet request fails and complains that the field doesn't exist.
> > > > > 
> > > > > Is there a way to have facets safely return empty result if no such  
> > > > > field exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > > > > especially in cases where indexes are rolling, and we don't know ahead of  
> > > > > time if an index is empty or not before it is searched.
> > > > > 
> > > > > Thanks,  
> > > > > -Vinh
> > > > > 
> > > > > --  
> > > > > 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).
> > > > 
> > > > --  
> > > > 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).
> > > 
> > > --  
> > > 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).
> 
> --  
> 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: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [June 24, 2013, 11:17pm UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/9 "2013-06-24T23:17:29Z")

</div>

That change is not in 0.90.1, only on master.

--  
Ivan

On Sun, Jun 23, 2013 at 8:20 PM, Matt Weber [matt.weber@gmail.com](mailto:matt.weber@gmail.com) wrote:

> I believe you can set "ignore\_unmapped" to true as of 0.90.1. If not, it  
> will definitely be in the next release.
> 
> [https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1](https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1)
> 
> So something like this should work:
> 
> "myfacet": {  
> "terms": {  
> "field": "an\_unmapped\_field",  
> "ignore\_unmapped": true  
> }  
> }
> 
> Hope this helps.
> 
> Thanks,  
> Matt Weber
> 
> On Sun, Jun 23, 2013 at 7:39 PM, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) wrote:
> 
> > ES is throwing an exception when a mapping doesn't exist for the field  
> > I'm faceting on. To fix this, I have to manually check for the mapping  
> > first, then return an empty result if the mapping is missing.
> > 
> > However, when I do a search on a nonexistent field, I just get back an  
> > empty result set - no exception occurs. Isn't this inconsistent?
> > 
> > A
> > 
> > On Mon, Jun 24, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > How can you ask for a facet on fields you don't know?  
> > > I think I missed something here.
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > 
> > > Hi David,
> > > 
> > > I don't know ahead of time what fields are going to exist in the index,  
> > > so no.
> > > 
> > > Thanks  
> > > A
> > > 
> > > On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > 
> > > > What happens if you put a mapping for your type in the same time you  
> > > > create your new index?
> > > > 
> > > > Could this solve your issue?
> > > > 
> > > > ## HTH
> > > > 
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > > 
> > > > I posted a duplicate question just a few days ago, awaiting response  
> > > > also:
> > > > 
> > > > Hi all,
> > > > 
> > > > When doing a faceted filter/query where the facet term doesn't exist in  
> > > > any document, is it possible for elasticsearch to return an empty facet  
> > > > result, rather than throw an exception?
> > > > 
> > > > If this isn't possible, would it be reasonable to add an option to the  
> > > > API to turn this functionality on?
> > > > 
> > > > Thanks
> > > > 
> > > > On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > > 
> > > > > Normally, my index has documents with a particular field, so facet  
> > > > > requests on that field succeeds. But this time, if the index is empty, the  
> > > > > facet request fails and complains that the field doesn't exist.
> > > > > 
> > > > > Is there a way to have facets safely return empty result if no such  
> > > > > field exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > > > > especially in cases where indexes are rolling, and we don't know ahead of  
> > > > > time if an index is empty or not before it is searched.
> > > > > 
> > > > > Thanks,  
> > > > > -Vinh
> > > > > 
> > > > > --  
> > > > > 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).
> > > > 
> > > > --  
> > > > 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).
> > > 
> > > --  
> > > 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).
> 
> --  
> 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: ![Allan\_Johns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allan_johns/32/2387_2.png) [@Allan\_Johns](https://discuss.elastic.co/u/Allan_Johns)
#### Post date: [June 24, 2013, 11:47pm UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/10 "2013-06-24T23:47:09Z")

</div>

Good to know Ivan, thanks.

On Tue, Jun 25, 2013 at 9:17 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> That change is not in 0.90.1, only on master.
> 
> --  
> Ivan
> 
> On Sun, Jun 23, 2013 at 8:20 PM, Matt Weber [matt.weber@gmail.com](mailto:matt.weber@gmail.com) wrote:
> 
> > I believe you can set "ignore\_unmapped" to true as of 0.90.1. If not, it  
> > will definitely be in the next release.
> > 
> > [https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1](https://github.com/uboness/elasticsearch/commit/a023e6e4b76482df48ff87f2c16a79c4ce6216f1)
> > 
> > So something like this should work:
> > 
> > "myfacet": {  
> > "terms": {  
> > "field": "an\_unmapped\_field",  
> > "ignore\_unmapped": true  
> > }  
> > }
> > 
> > Hope this helps.
> > 
> > Thanks,  
> > Matt Weber
> > 
> > On Sun, Jun 23, 2013 at 7:39 PM, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) wrote:
> > 
> > > ES is throwing an exception when a mapping doesn't exist for the field  
> > > I'm faceting on. To fix this, I have to manually check for the mapping  
> > > first, then return an empty result if the mapping is missing.
> > > 
> > > However, when I do a search on a nonexistent field, I just get back an  
> > > empty result set - no exception occurs. Isn't this inconsistent?
> > > 
> > > A
> > > 
> > > On Mon, Jun 24, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > 
> > > > How can you ask for a facet on fields you don't know?  
> > > > I think I missed something here.
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 24 juin 2013 à 01:41, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > > 
> > > > Hi David,
> > > > 
> > > > I don't know ahead of time what fields are going to exist in the index,  
> > > > so no.
> > > > 
> > > > Thanks  
> > > > A
> > > > 
> > > > On Sun, Jun 23, 2013 at 2:06 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > > 
> > > > > What happens if you put a mapping for your type in the same time you  
> > > > > create your new index?
> > > > > 
> > > > > Could this solve your issue?
> > > > > 
> > > > > ## HTH
> > > > > 
> > > > > David 😉  
> > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > 
> > > > > Le 23 juin 2013 à 02:47, Allan Johns [nerdvegas@gmail.com](mailto:nerdvegas@gmail.com) a écrit :
> > > > > 
> > > > > I posted a duplicate question just a few days ago, awaiting response  
> > > > > also:
> > > > > 
> > > > > Hi all,
> > > > > 
> > > > > When doing a faceted filter/query where the facet term doesn't exist  
> > > > > in any document, is it possible for elasticsearch to return an empty facet  
> > > > > result, rather than throw an exception?
> > > > > 
> > > > > If this isn't possible, would it be reasonable to add an option to the  
> > > > > API to turn this functionality on?
> > > > > 
> > > > > Thanks
> > > > > 
> > > > > On Fri, Jun 21, 2013 at 12:02 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:
> > > > > 
> > > > > > Normally, my index has documents with a particular field, so facet  
> > > > > > requests on that field succeeds. But this time, if the index is empty, the  
> > > > > > facet request fails and complains that the field doesn't exist.
> > > > > > 
> > > > > > Is there a way to have facets safely return empty result if no such  
> > > > > > field exists? Similar to how sorting has "ignore\_unmapped". Need this  
> > > > > > especially in cases where indexes are rolling, and we don't know ahead of  
> > > > > > time if an index is empty or not before it is searched.
> > > > > > 
> > > > > > Thanks,  
> > > > > > -Vinh
> > > > > > 
> > > > > > --  
> > > > > > 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).
> > > > > 
> > > > > --  
> > > > > 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).
> > > > 
> > > > --  
> > > > 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).
> > 
> > --  
> > 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).

--  
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:29am UTC](https://discuss.elastic.co/t/facet-on-non-existent-field-throws-error/12501/11 "2017-07-06T02:29:40Z")

</div>


