# Specifying document type in search query - performance impact for single shard index

**URL:** <https://discuss.elastic.co/t/specifying-document-type-in-search-query-performance-impact-for-single-shard-index/20889>\
**Category:** Elasticsearch\
**Created:** [November 21, 2014, 3:06pm UTC](https://discuss.elastic.co/t/specifying-document-type-in-search-query-performance-impact-for-single-shard-index/20889 "2014-11-21T15:06:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajay\_Divakaran](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Ajay\_Divakaran](https://discuss.elastic.co/u/Ajay_Divakaran)\
**Post date:** [November 21, 2014, 3:06pm UTC](https://discuss.elastic.co/t/specifying-document-type-in-search-query-performance-impact-for-single-shard-index/20889/1 "2014-11-21T15:06:28Z")

</div>

Hi all,

If I have an elasticsearch index with a single shard and 0 replicas. Will  
specifying a document-type part of the match\_all query help in performance  
(i.e narrowing down the result-set)?

i.e '[http://localhost:9200/my-index/my-doc-type/\_search](http://localhost:9200/my-index/my-doc-type/_search) vs  
'[http://localhost:9200/my-index/\_search](http://localhost:9200/my-index/_search)

--  
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/0c5865dd-6aa7-466b-8006-5a2e3cfef139%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c5865dd-6aa7-466b-8006-5a2e3cfef139%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ajay\_Divakaran](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Ajay\_Divakaran](https://discuss.elastic.co/u/Ajay_Divakaran)\
**Post date:** [November 21, 2014, 4:21pm UTC](https://discuss.elastic.co/t/specifying-document-type-in-search-query-performance-impact-for-single-shard-index/20889/2 "2014-11-21T16:21:52Z")

</div>

This is what I found from the documentation

"When we search for documents of a particular type, Elasticsearch simply  
uses a filter on the \_type field to restrict results to documents of that  
type."

So it seems the answer is yes.

On Friday, November 21, 2014 8:36:28 PM UTC+5:30, Ajay Divakaran wrote:

> Hi all,
> 
> If I have an elasticsearch index with a single shard and 0 replicas. Will  
> specifying a document-type part of the match\_all query help in performance  
> (i.e narrowing down the result-set)?
> 
> i.e '[http://localhost:9200/my-index/my-doc-type/\_search](http://localhost:9200/my-index/my-doc-type/_search) vs '  
> [http://localhost:9200/my-index/\_search](http://localhost:9200/my-index/_search)

--  
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/d32ddedd-8bba-4218-819f-a34fe0cae956%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d32ddedd-8bba-4218-819f-a34fe0cae956%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, 12:48am UTC](https://discuss.elastic.co/t/specifying-document-type-in-search-query-performance-impact-for-single-shard-index/20889/3 "2017-07-06T00:48:24Z")

</div>

Closed on July 6, 2017, 12:48am UTC


