how to suppress ElasticSearchIllegalArgumentException[failed to find mappings for [object1.object2.field]]; }] errors


(revdev) #1

I am performing a facet query on a dynamic object field but if field is not
already indexed, I get an error
"ElasticSearchIllegalArgumentException[failed to find mappings for
[object1.object2.field]]; }]" since it is not available in the mapping. Is
there anyway to suppress that warming and just return no results ?
Thanks!
Vinay

--


(revdev) #2

Any idea how to suppress these errors? Otherwise, I need to keep track of
what all dynamic fields were indexed and then request only those which is
not ideal.
thanks in advance.

On Tuesday, November 6, 2012 1:55:05 PM UTC-8, revdev wrote:

I am performing a facet query on a dynamic object field but if field is
not already indexed, I get an error
"ElasticSearchIllegalArgumentException[failed to find mappings for
[object1.object2.field]]; }]" since it is not available in the mapping. Is
there anyway to suppress that warming and just return no results ?
Thanks!
Vinay

--


(Radu Gheorghe) #3

Hello,

What do you mean by "facet query"? Can you provide some sample data
and a sample query?

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Wed, Nov 7, 2012 at 7:58 AM, revdev clickingcam@gmail.com wrote:

Any idea how to suppress these errors? Otherwise, I need to keep track of
what all dynamic fields were indexed and then request only those which is
not ideal.
thanks in advance.

On Tuesday, November 6, 2012 1:55:05 PM UTC-8, revdev wrote:

I am performing a facet query on a dynamic object field but if field is
not already indexed, I get an error
"ElasticSearchIllegalArgumentException[failed to find mappings for
[object1.object2.field]]; }]" since it is not available in the mapping. Is
there anyway to suppress that warming and just return no results ?
Thanks!
Vinay

--

--


(Chris Male) #4

Hi,

What would you like to happen instead of the error? The error is reporting
that the mapping wasn't found and so it cannot create any facet information.

On Wednesday, November 7, 2012 4:58:47 PM UTC+11, revdev wrote:

Any idea how to suppress these errors? Otherwise, I need to keep track of
what all dynamic fields were indexed and then request only those which is
not ideal.
thanks in advance.

On Tuesday, November 6, 2012 1:55:05 PM UTC-8, revdev wrote:

I am performing a facet query on a dynamic object field but if field is
not already indexed, I get an error
"ElasticSearchIllegalArgumentException[failed to find mappings for
[object1.object2.field]]; }]" since it is not available in the mapping. Is
there anyway to suppress that warming and just return no results ?
Thanks!
Vinay

--


(revdev) #5

Thanks Chris, Radu for helping out!

Here is my scenario: The reason I chose dynamic mapping (via templates) is
that I am not completely aware of what fields will be indexed (thus mapped)
on the fly. If I knew the exact range/domain of fields that I would
encounter, I would have created explicit mappings. So, if I query (any
facet query) for say 100 such fields and even if 1 of them is absent, I get
an exception from ES with "missing mapping" error. This means that I am
required to know what fields are already mapped before sending a query
which makes dynamic mapping less useful to me. I would love to get response
for other 99 fields which were present in the mapping rather than a failed
query. ES can just skip the fields that are not present in mapping. Does it
make sense?

Thanks!
Vinay

On Wednesday, November 7, 2012 2:26:43 AM UTC-8, Chris Male wrote:

Hi,

What would you like to happen instead of the error? The error is reporting
that the mapping wasn't found and so it cannot create any facet information.

On Wednesday, November 7, 2012 4:58:47 PM UTC+11, revdev wrote:

Any idea how to suppress these errors? Otherwise, I need to keep track of
what all dynamic fields were indexed and then request only those which is
not ideal.
thanks in advance.

On Tuesday, November 6, 2012 1:55:05 PM UTC-8, revdev wrote:

I am performing a facet query on a dynamic object field but if field is
not already indexed, I get an error
"ElasticSearchIllegalArgumentException[failed to find mappings for
[object1.object2.field]]; }]" since it is not available in the mapping. Is
there anyway to suppress that warming and just return no results ?
Thanks!
Vinay

--


(Drew Raines) #6

revdev wrote:

Here is my scenario: The reason I chose dynamic mapping (via
templates) is that I am not completely aware of what fields will be
indexed (thus mapped) on the fly.

ES will update the mapping for you, so you don't need templates just
for that case. You could issue a call to /index/_mapping and inspect
what fields exist, then construct your facet query from there.

-Drew

--


(revdev) #7

Thanks Drew.

  • The reason I used templates is because I want to enforce specific date
    type for the incoming fields so that faceting operation doesnt take too
    much RAM.
  • Yes, I can query mappings api to get extract existing mappings but that
    adds 50-100ms to each of my queries. I can cache it in memcached but still
    its added code complexity.

I am just wondering why ES returns an error message vs skipping data for
the field? If there is a setting to disable error in this scenario, it
would solve my problem.

Vinay

On Wednesday, November 7, 2012 11:37:30 AM UTC-8, Drew Raines wrote:

revdev wrote:

Here is my scenario: The reason I chose dynamic mapping (via
templates) is that I am not completely aware of what fields will be
indexed (thus mapped) on the fly.

ES will update the mapping for you, so you don't need templates just
for that case. You could issue a call to /index/_mapping and inspect
what fields exist, then construct your facet query from there.

-Drew

--


(system) #8