# Failed to find mapping for

**URL:** <https://discuss.elastic.co/t/failed-to-find-mapping-for/17149>\
**Category:** Elasticsearch\
**Created:** [April 23, 2014, 11:37am UTC](https://discuss.elastic.co/t/failed-to-find-mapping-for/17149 "2014-04-23T11:37:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![11147](https://avatars.discourse-cdn.com/v4/letter/1/76d3ee/32.png) [@11147](https://discuss.elastic.co/u/11147)\
**Post date:** [April 23, 2014, 11:37am UTC](https://discuss.elastic.co/t/failed-to-find-mapping-for/17149/1 "2014-04-23T11:37:42Z")

</div>

Hi! Guys!  
Im novice in elesticsearch.. Now I have this request:

{"size":100,"from":0,  
"query":{  
"filtered":{  
"filter":{  
"and":[  
{"exists" : {"field" : "psp\_name" }}  
]  
}  
}  
},  
"facets":{  
"txtamountusdtransaction\_sum":{  
"facet\_filter":{  
"exists" : {"field" : "psp\_name" }  
},  
"terms\_stats":{  
"key\_field":"psp\_name",  
"value\_field":"txt\_amount\_usd\_transaction"  
}  
}  
}  
}

My mission make work facets. But I always get error about "failed to find  
mapping for psp\_name]"

{"error":"SearchPhaseExecutionException[Failed to execute phase [query],  
all shards failed; shardFailures  
{[DOGYFjtdS26ba9lKa44-BA][.marvel-2014.04.12][0]:  
SearchParseException[[.marvel-2014.04.12][0]:  
query[ConstantScore(+cache(BooleanFilter(psp\_name:[\* TO  
\*])))],from[0],size[100]: Parse Failure [Failed to parse source  
[{"size":100,"from":0,\n\t"query":{\n \t"filtered":{\n  
\t\t"filter":{\n \t\t"and":[\n \t\t\t{"exists" : {"field" :  
"psp\_name" }}\n \t]\n \t\t}\n }\n },\n "facets":{\n  
\t"txtamountusdtransaction\_sum":{\n \t"facet\_filter":{\n \t\t"exists"  
: {"field" : "psp\_name" }\n \t},\n \t"terms\_stats":{\n  
\t"key\_field":"psp\_name",\n  
"value\_field":"txt\_amount\_usd\_transaction"\n }\n }\n }\n}]]]; nested:  
FacetPhaseExecutionException[Facet [txtamountusdtransaction\_sum]: failed to  
find mapping for psp\_name]; }

For exaple, if my request looks like this:  
My response containg nice data, and field "psp\_name" for each  
"hits" contains anything!

{  
"took": 13788,  
"timed\_out": false,  
"\_shards": {  
"total": 126,  
"successful": 126,  
"failed": 0  
},  
"hits": {  
"total": 2264,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "logstash-2014.04.17",  
"\_type": "app",  
"\_id": "JxxxnDjdTMe0MLM34VyOrw",  
"\_score": 1,  
"\_source": {  
"@fields": {  
"environment": "production",  
"project": "**_",  
"psp\_status": "success",  
"psp\_name": "asd",  
"mobile\_app": "false",  
"txt\_amount\_transaction": "30.0 USD",  
"txt\_amount\_usd\_transacrion": 30,  
"txt\_amount\_user\_transaction": "30.0 USD",  
"txt\_response\_from\_server":  
"_ **** _",  
"level": "DEPOSIT",  
"txt\_account\_number": ,  
"txt\_origin\_id": 24,  
"txt\_request\_to\_server": "_"  
},  
"@source\_path": "/var/www/ ****",  
"@source\_host": "**\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
"@type": "app",  
"@source": "\*\*\***",  
"message": "**",  
"type": "app",  
"@tags": [],  
"@timestamp": "2014-04-17T01:22:14.837+01:00",  
"@version": "1"  
}  
},  
................................,  
.................................,

But if I try get all data:  
{"size":100,"from":0,  
"query":{  
"match\_all" : {}  
}  
}

_I have:_  
"hits": {  
"total": 45848,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "logstash-2014.04.17",  
"\_type": "app",  
"\_id": "SF32k0WtQz6yRFiGgDWq9w",  
"\_score": 1,  
"\_source": {  
"@source": "**_",  
"@type": "app",  
"@tags": [],  
"@fields": {  
"level": "ERROR",  
"class": "NoMethodError",  
"txt\_backtrace": "\*\*\*\*\*\*\*\*\*\*\*",  
"betrails\_host": "",  
"betrails\_http\_host": "_ **** _",  
"txt\_uri": "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
"txt\_params": "_ **** _",  
"txt\_session": "_ **\*** _",  
"user\_id": "",  
"txt\_referer": null,  
"environment": "production",  
"project": "\*\*\*\*\*rails"  
},  
"message": "undefined method `tag' for nil:NilClass",  
"type": "app",  
"@source\_host": ".int",  
"@source\_path": "/var/www/www._**.com",  
"@timestamp": "2014-04-17T01:00:39.591+01:00",  
"@version": "1"  
}  
},

As you can see, psp\_name not present in last response...  
Maybe the problem is that some records not have psp\_name field ? Why my "facet\_filter"  
in first request does not work ?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 26, 2014, 12:14am UTC](https://discuss.elastic.co/t/failed-to-find-mapping-for/17149/2 "2014-04-26T00:14:43Z")

</div>

Hey,

is it possible that you are querying indices, where the psp\_name field does  
not exist at all and thus has no mapping? Can you try that search request  
against an index with this field and see if it works?

--Alex

On Wed, Apr 23, 2014 at 7:37 AM, Дмитрий Хромов [devandart31@gmail.com](mailto:devandart31@gmail.com)wrote:

> Hi! Guys!  
> Im novice in elesticsearch.. Now I have this request:
> 
> {"size":100,"from":0,  
> "query":{  
> "filtered":{  
> "filter":{  
> "and":[  
> {"exists" : {"field" : "psp\_name" }}  
> ]  
> }  
> }  
> },  
> "facets":{  
> "txtamountusdtransaction\_sum":{  
> "facet\_filter":{  
> "exists" : {"field" : "psp\_name" }  
> },  
> "terms\_stats":{  
> "key\_field":"psp\_name",  
> "value\_field":"txt\_amount\_usd\_transaction"  
> }  
> }  
> }  
> }
> 
> My mission make work facets. But I always get error about "failed to find  
> mapping for psp\_name]"
> 
> {"error":"SearchPhaseExecutionException[Failed to execute phase [query],  
> all shards failed; shardFailures  
> {[DOGYFjtdS26ba9lKa44-BA][.marvel-2014.04.12][0]:  
> SearchParseException[[.marvel-2014.04.12][0]:  
> query[ConstantScore(+cache(BooleanFilter(psp\_name:[\* TO  
> \*])))],from[0],size[100]: Parse Failure [Failed to parse source  
> [{"size":100,"from":0,\n\t"query":{\n \t"filtered":{\n  
> \t\t"filter":{\n \t\t"and":[\n \t\t\t{"exists" : {"field" :  
> "psp\_name" }}\n \t]\n \t\t}\n }\n },\n "facets":{\n  
> \t"txtamountusdtransaction\_sum":{\n \t"facet\_filter":{\n \t\t"exists"  
> : {"field" : "psp\_name" }\n \t},\n \t"terms\_stats":{\n  
> \t"key\_field":"psp\_name",\n  
> "value\_field":"txt\_amount\_usd\_transaction"\n }\n }\n }\n}]]]; nested:  
> FacetPhaseExecutionException[Facet [txtamountusdtransaction\_sum]: failed to  
> find mapping for psp\_name]; }
> 
> For exaple, if my request looks like this:  
> My response containg nice data, and field "psp\_name" for each  
> "hits" contains anything!
> 
> {  
> "took": 13788,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 126,  
> "successful": 126,  
> "failed": 0  
> },  
> "hits": {  
> "total": 2264,  
> "max\_score": 1,  
> "hits": [  
> {  
> "\_index": "logstash-2014.04.17",  
> "\_type": "app",  
> "\_id": "JxxxnDjdTMe0MLM34VyOrw",  
> "\_score": 1,  
> "\_source": {  
> "@fields": {  
> "environment": "production",  
> "project": "_**",  
> "psp\_status": "success",  
> "psp\_name": "asd",  
> "mobile\_app": "false",  
> "txt\_amount\_transaction": "30.0 USD",  
> "txt\_amount\_usd\_transacrion": 30,  
> "txt\_amount\_user\_transaction": "30.0 USD",  
> "txt\_response\_from\_server":  
> " **_** _",  
> "level": "DEPOSIT",  
> "txt\_account\_number": ,  
> "txt\_origin\_id": 24,  
> "txt\_request\_to\_server": "_"  
> },  
> "@source\_path": "/var/www/ ****",  
> "@source\_host": "**\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
> "@type": "app",  
> "@source": "\*\*\***",  
> "message": "**",  
> "type": "app",  
> "@tags": ,  
> "@timestamp": "2014-04-17T01:22:14.837+01:00",  
> "@version": "1"  
> }  
> },  
> ................................,  
> .................................,
> 
> But if I try get all data:  
> {"size":100,"from":0,  
> "query":{  
> "match\_all" : {}  
> }  
> }
> 
> _I have:_  
> "hits": {  
> "total": 45848,  
> "max\_score": 1,  
> "hits": [  
> {  
> "\_index": "logstash-2014.04.17",  
> "\_type": "app",  
> "\_id": "SF32k0WtQz6yRFiGgDWq9w",  
> "\_score": 1,  
> "\_source": {  
> "@source": "_**",  
> "@type": "app",  
> "@tags": [],  
> "@fields": {  
> "level": "ERROR",  
> "class": "NoMethodError",  
> "txt\_backtrace": "\*\*\*\*\*\*\*\*\*\*\*",  
> "betrails\_host": "",  
> "betrails\_http\_host": " **__**",  
> "txt\_uri": "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
> "txt\_params": " **__**",  
> "txt\_session": " **_\*_**",  
> "user\_id": "",  
> "txt\_referer": null,  
> "environment": "production",  
> "project": "\*\*\*\*\*rails"  
> },  
> "message": "undefined method `tag' for nil:NilClass",  
> "type": "app",  
> "@source\_host": ".int",  
> "@source\_path": "/var/www/www.**_.com",  
> "@timestamp": "2014-04-17T01:00:39.591+01:00",  
> "@version": "1"  
> }  
> },
> 
> As you can see, psp\_name not present in last response...  
> Maybe the problem is that some records not have psp\_name field ? Why my "facet\_filter"  
> in first request does not work ?
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8\_WWies0%3Depi\_x-KemLDLA\_9rOtrYahVPZGfnaDzcgcQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8_WWies0%3Depi_x-KemLDLA_9rOtrYahVPZGfnaDzcgcQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [April 26, 2014, 7:44pm UTC](https://discuss.elastic.co/t/failed-to-find-mapping-for/17149/3 "2014-04-26T19:44:03Z")

</div>

Hi,

It looks like you have marvel installed and it's storing it's data locally,  
indices called .marvel-YYYY.MM.DD (for example, taken from your error  
msg: .marvel-2014.04.12 ). The marvel indices do not have a field called  
psp\_name and I guess that's your problem. Remember that  
[http://SERVER:9200/\_search](http://SERVER:9200/_search) searches all the indices.

As Alex suggested, try directing your search at the logstash indices:  
[http://SERVER:9200/logstash-2014.04.17/\_search](http://SERVER:9200/logstash-2014.04.17/_search) and see if that works.

Cheers,  
Boaz

On Saturday, April 26, 2014 2:14:43 AM UTC+2, Alexander Reelsen wrote:

> Hey,
> 
> is it possible that you are querying indices, where the psp\_name field  
> does not exist at all and thus has no mapping? Can you try that search  
> request against an index with this field and see if it works?
> 
> --Alex
> 
> On Wed, Apr 23, 2014 at 7:37 AM, Дмитрий Хромов [devandart31@gmail.com](mailto:devandart31@gmail.com)wrote:
> 
> > Hi! Guys!  
> > Im novice in elesticsearch.. Now I have this request:
> > 
> > {"size":100,"from":0,  
> > "query":{  
> > "filtered":{  
> > "filter":{  
> > "and":[  
> > {"exists" : {"field" : "psp\_name" }}  
> > ]  
> > }  
> > }  
> > },  
> > "facets":{  
> > "txtamountusdtransaction\_sum":{  
> > "facet\_filter":{  
> > "exists" : {"field" : "psp\_name" }  
> > },  
> > "terms\_stats":{  
> > "key\_field":"psp\_name",  
> > "value\_field":"txt\_amount\_usd\_transaction"  
> > }  
> > }  
> > }  
> > }
> > 
> > My mission make work facets. But I always get error about "failed to  
> > find mapping for psp\_name]"
> > 
> > {"error":"SearchPhaseExecutionException[Failed to execute phase [query],  
> > all shards failed; shardFailures  
> > {[DOGYFjtdS26ba9lKa44-BA][.marvel-2014.04.12][0]:  
> > SearchParseException[[.marvel-2014.04.12][0]:  
> > query[ConstantScore(+cache(BooleanFilter(psp\_name:[\* TO  
> > \*])))],from[0],size[100]: Parse Failure [Failed to parse source  
> > [{"size":100,"from":0,\n\t"query":{\n \t"filtered":{\n  
> > \t\t"filter":{\n \t\t"and":[\n \t\t\t{"exists" : {"field" :  
> > "psp\_name" }}\n \t]\n \t\t}\n }\n },\n "facets":{\n  
> > \t"txtamountusdtransaction\_sum":{\n \t"facet\_filter":{\n \t\t"exists"  
> > : {"field" : "psp\_name" }\n \t},\n \t"terms\_stats":{\n  
> > \t"key\_field":"psp\_name",\n  
> > "value\_field":"txt\_amount\_usd\_transaction"\n }\n }\n }\n}]]]; nested:  
> > FacetPhaseExecutionException[Facet [txtamountusdtransaction\_sum]: failed to  
> > find mapping for psp\_name]; }
> > 
> > For exaple, if my request looks like this:  
> > My response containg nice data, and field "psp\_name" for each  
> > "hits" contains anything!
> > 
> > {  
> > "took": 13788,  
> > "timed\_out": false,  
> > "\_shards": {  
> > "total": 126,  
> > "successful": 126,  
> > "failed": 0  
> > },  
> > "hits": {  
> > "total": 2264,  
> > "max\_score": 1,  
> > "hits": [  
> > {  
> > "\_index": "logstash-2014.04.17",  
> > "\_type": "app",  
> > "\_id": "JxxxnDjdTMe0MLM34VyOrw",  
> > "\_score": 1,  
> > "\_source": {  
> > "@fields": {  
> > "environment": "production",  
> > "project": "_**",  
> > "psp\_status": "success",  
> > "psp\_name": "asd",  
> > "mobile\_app": "false",  
> > "txt\_amount\_transaction": "30.0 USD",  
> > "txt\_amount\_usd\_transacrion": 30,  
> > "txt\_amount\_user\_transaction": "30.0 USD",  
> > "txt\_response\_from\_server":  
> > " **_** _",  
> > "level": "DEPOSIT",  
> > "txt\_account\_number": ,  
> > "txt\_origin\_id": 24,  
> > "txt\_request\_to\_server": "_"  
> > },  
> > "@source\_path": "/var/www/ ****",  
> > "@source\_host": "**\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
> > "@type": "app",  
> > "@source": "\*\*\***",  
> > "message": "**",  
> > "type": "app",  
> > "@tags": ,  
> > "@timestamp": "2014-04-17T01:22:14.837+01:00",  
> > "@version": "1"  
> > }  
> > },  
> > ................................,  
> > .................................,
> > 
> > But if I try get all data:  
> > {"size":100,"from":0,  
> > "query":{  
> > "match\_all" : {}  
> > }  
> > }
> > 
> > _I have:_  
> > "hits": {  
> > "total": 45848,  
> > "max\_score": 1,  
> > "hits": [  
> > {  
> > "\_index": "logstash-2014.04.17",  
> > "\_type": "app",  
> > "\_id": "SF32k0WtQz6yRFiGgDWq9w",  
> > "\_score": 1,  
> > "\_source": {  
> > "@source": "_**",  
> > "@type": "app",  
> > "@tags": [],  
> > "@fields": {  
> > "level": "ERROR",  
> > "class": "NoMethodError",  
> > "txt\_backtrace": "\*\*\*\*\*\*\*\*\*\*\*",  
> > "betrails\_host": "",  
> > "betrails\_http\_host": " **__**",  
> > "txt\_uri": "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*",  
> > "txt\_params": " **__**",  
> > "txt\_session": " **_\*_**",  
> > "user\_id": "",  
> > "txt\_referer": null,  
> > "environment": "production",  
> > "project": "\*\*\*\*\*rails"  
> > },  
> > "message": "undefined method `tag' for nil:NilClass",  
> > "type": "app",  
> > "@source\_host": ".int",  
> > "@source\_path": "/var/www/www.**_.com",  
> > "@timestamp": "2014-04-17T01:00:39.591+01:00",  
> > "@version": "1"  
> > }  
> > },
> > 
> > As you can see, psp\_name not present in last response...  
> > Maybe the problem is that some records not have psp\_name field ? Why my "facet\_filter"  
> > in first request does not work ?
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/033430d8-3b26-4e27-ad16-2c7bf3f0d2c8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/033430d8-3b26-4e27-ad16-2c7bf3f0d2c8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:33am UTC](https://discuss.elastic.co/t/failed-to-find-mapping-for/17149/4 "2017-07-06T01:33:14Z")

</div>


