when i try to sort over a dynamically created field the query crashes when
the field does not exist cause there is no mapping for this field available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
is it possible to combine an exist check with the sorting?
when i try to sort over a dynamically created field the query crashes when
the field does not exist cause there is no mapping for this field available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
You can use dynamic templates (scroll down to dynamic_templates):
is it possible to combine an exist check with the sorting?
Not sure what your use case is, but can you use the Missing Values feature?
You can put documents that do not have the field to the bottom, or give
them a default value that can be filterered out on the client side.
other solutions?
Depends on your use case. What is not working with the existing solutions?
Am Donnerstag, 24. Januar 2013 18:02:02 UTC+1 schrieb Ivan Brusic:
Answers inline.
On Thu, Jan 24, 2013 at 12:39 AM, Tom <t.op...@superreal.de <javascript:>>wrote:
Hi,
when i try to sort over a dynamically created field the query crashes
when the field does not exist cause there is no mapping for this field
available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
sorry i pasted wrong query in my last post of course i query for
mysort_notexists field. but it makes no difference.
Am Donnerstag, 24. Januar 2013 09:39:45 UTC+1 schrieb Tom:
Hi,
when i try to sort over a dynamically created field the query crashes when
the field does not exist cause there is no mapping for this field available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
is it possible to combine an exist check with the sorting?
Sorry! I answered your questions, but forgot to address the main issue.
Try using the ignore_unmapped option when sorting against on unmapped
field. Might not be the best solution, but it will stop the exception from
occurring.
sorry i pasted wrong query in my last post of course i query for
mysort_notexists field. but it makes no difference.
Am Donnerstag, 24. Januar 2013 09:39:45 UTC+1 schrieb Tom:
Hi,
when i try to sort over a dynamically created field the query crashes
when the field does not exist cause there is no mapping for this field
available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
is it possible to combine an exist check with the sorting?
hm, ok, but actually this field is mapped by dynamic_template.
so there is a mapping available actually, but the specific dynamic field
does not exist.
disturbing.
Am Freitag, 25. Januar 2013 17:02:52 UTC+1 schrieb Ivan Brusic:
Sorry! I answered your questions, but forgot to address the main issue.
Try using the ignore_unmapped option when sorting against on unmapped
field. Might not be the best solution, but it will stop the exception from
occurring.
sorry i pasted wrong query in my last post of course i query for
mysort_notexists field. but it makes no difference.
Am Donnerstag, 24. Januar 2013 09:39:45 UTC+1 schrieb Tom:
Hi,
when i try to sort over a dynamically created field the query crashes
when the field does not exist cause there is no mapping for this field
available.
is there a way to set something like a default mapping with wildcards
for dyn fields like "myid_*" ?
is it possible to combine an exist check with the sorting?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.