Facet on non-existent field throws error

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

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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 wrote:

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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

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 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 wrote:

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 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

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 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 wrote:

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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 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

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 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 wrote:

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Good to know Ivan, thanks.

On Tue, Jun 25, 2013 at 9:17 AM, Ivan Brusic 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 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

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 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 wrote:

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

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

Le 24 juin 2013 à 01:41, Allan Johns 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 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 :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 juin 2013 à 02:47, Allan Johns 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 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.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.