facet on non-existent field throws error

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

facet on non-existent field throws error

vinh
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Allan Johns
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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

dadoonet
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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Allan Johns
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

dadoonet
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Allan Johns
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Matt Weber-2
I believe you can set "ignore_unmapped" to true as of 0.90.1.  If not, it will definitely be in the next release.


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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Allan Johns
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 <[hidden email]> 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.


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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Ivan Brusic
In reply to this post by Matt Weber-2
That change is not in 0.90.1, only on master.

-- 
Ivan


On Sun, Jun 23, 2013 at 8:20 PM, Matt Weber <[hidden email]> 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.


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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: facet on non-existent field throws error

Allan Johns
Good to know Ivan, thanks.



On Tue, Jun 25, 2013 at 9:17 AM, Ivan Brusic <[hidden email]> wrote:
That change is not in 0.90.1, only on master.

-- 
Ivan


On Sun, Jun 23, 2013 at 8:20 PM, Matt Weber <[hidden email]> 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.


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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.