# Problem creating percolator - No field mapping can be found for the field with name

**URL:** <https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087>\
**Category:** Elasticsearch\
**Created:** [February 5, 2016, 5:04pm UTC](https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087 "2016-02-05T17:04:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Ramage](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@Ryan\_Ramage](https://discuss.elastic.co/u/Ryan_Ramage)\
**Post date:** [February 5, 2016, 5:04pm UTC](https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087/1 "2016-02-05T17:04:21Z")

</div>

I am having a problem creating a percolator. I feel that I am doing everything according to the docs, so help would be appreciated.

The root of my issue is I cant create a percolator document. The put is like this:

```
 git:(master) 3M ®[assets]$ http PUT http://elastic-1:9200/idx-edm-v5/.percolator/2 < sample_percolate.json
HTTP/1.1 500 Internal Server Error
Content-Length: 221
Content-Type: application/json; charset=UTF-8

{
    "error": "PercolatorException[[idx-edm-v5] failed to parse query [2]]; nested: QueryParsingException[[idx-edm-v5] Strict field resolution and no field mapping can be found for the field with name [price]]; ",
    "status": 500
}

```

Where sample\_percolate.json looks like:

```
{
  "type": "saved-search",
  "account": "01P_KBhB4UMnjZLSjhV4NG--/forms~rwp-1839",
  "query": {
    "filtered": {
      "query": [
        {
          "match_all": {}
        }
      ],
      "filter": {
        "and": [
          {
            "range": {
              "price": {
                "gte": 100000
              }
            }
          },
          {
            "range": {
              "price": {
                "lte": 150000
              }
            }
          }
        ]
      }
    }
  }
}

```

I use this exact query in the \_search endpoint and it works fine, so I am trying to use the same format for the percolate.

I already have a mapping defined, which is quite large, but here I show that the index has a mapping called listing, with a field called price, which is a long

```
git:(master) 4M ®[assets]$ http GET http://elastic-1:9200/idx-edm-v5/_mapping/listing/field/price
HTTP/1.1 200 OK
Content-Length: 107
Content-Type: application/json; charset=UTF-8

{
    "idx-edm-v5": {
        "mappings": {
            "listing": {
                "price": {
                    "full_name": "price",
                    "mapping": {
                        "price": {
                            "type": "long"
                        }
                    }
                }
            }
        }
    }
}

```

My version of elasticsearch

```
{
  "status" : 200,
  "name" : "Raving Beauty",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.5.0",
    "build_hash" : "544816042d40151d3ce4ba4f95399d7860dc2e92",
    "build_timestamp" : "2015-03-23T14:30:58Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

```

Can someone help me understand what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [February 5, 2016, 9:26pm UTC](https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087/2 "2016-02-05T21:26:18Z")

</div>

In `sample_percolate.json` you're referring to the type `saved-search` does this type have a price field?

The type field in a percolator query document tells ES what mapping to use when parsing the query:  
[https://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-percolate.html#\_indexing\_percolator\_queries](https://www.elastic.co/guide/en/elasticsearch/reference/1.5/search-percolate.html#_indexing_percolator_queries)

---

<div class="post-metadata">

**Author:** ![Ryan\_Ramage](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@Ryan\_Ramage](https://discuss.elastic.co/u/Ryan_Ramage)\
**Post date:** [February 5, 2016, 9:46pm UTC](https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087/3 "2016-02-05T21:46:30Z")

</div>

Wow that was it. Renaming the property name from 'type' to 'search-type' fixed it. I did not realize from the percolate docs that the 'type' property had semantic meaning.

Thanks!

---

<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 5, 2017, 11:18pm UTC](https://discuss.elastic.co/t/problem-creating-percolator-no-field-mapping-can-be-found-for-the-field-with-name/41087/4 "2017-07-05T23:18:27Z")

</div>


