# Percolator - how is \[type\] used when matching documents?

**URL:** <https://discuss.elastic.co/t/percolator-how-is-type-used-when-matching-documents/54559>\
**Category:** Elasticsearch\
**Created:** [July 1, 2016, 7:17pm UTC](https://discuss.elastic.co/t/percolator-how-is-type-used-when-matching-documents/54559 "2016-07-01T19:17:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![redtopia](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@redtopia](https://discuss.elastic.co/u/redtopia)\
**Post date:** [July 1, 2016, 7:17pm UTC](https://discuss.elastic.co/t/percolator-how-is-type-used-when-matching-documents/54559/1 "2016-07-01T19:17:15Z")

</div>

The Percolator API example usage doesn't really talk much about mappings.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html#\_sample\_usage](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-percolate.html#_sample_usage)

In the example, they're creating a mapping for "my-type" with a "message" field. Then when trying to match a document, they are calling this request: "/my-index/my-type/\_percolate". However, if I replace "my-type" with "this-doesnt-exist", I get the same results back. When I replace it with "products" (which does exist), I get the same results back, but it takes longer.

How exactly is "my-type" used when searching for matching documents?

---

<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:** [July 4, 2016, 6:40am UTC](https://discuss.elastic.co/t/percolator-how-is-type-used-when-matching-documents/54559/2 "2016-07-04T06:40:17Z")

</div>

The `type` option is used the tell the percolator how the index the document that you're percolating into a temporary memory index (that is used the evaluate your percolator queries against). For that it uses the mapping (and its configured field types, index settings, analyzers), which indicate how the field values in the document to be percolated should be analyzed when indexing.

If a type doesn't exist default field types and analyzers will be used. Perhaps your `products` type has different field types or analyzers is configured that cause the percolator queries to require to do more work. Can you share the `products` mapping?

---

<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, 10:38pm UTC](https://discuss.elastic.co/t/percolator-how-is-type-used-when-matching-documents/54559/3 "2017-07-05T22:38:39Z")

</div>


