# Constant score vs match all for simple filter

**URL:** <https://discuss.elastic.co/t/constant-score-vs-match-all-for-simple-filter/14411>\
**Category:** Elasticsearch\
**Created:** [November 14, 2013, 5:03pm UTC](https://discuss.elastic.co/t/constant-score-vs-match-all-for-simple-filter/14411 "2013-11-14T17:03:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arthurx](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@arthurx](https://discuss.elastic.co/u/arthurx)\
**Post date:** [November 14, 2013, 5:03pm UTC](https://discuss.elastic.co/t/constant-score-vs-match-all-for-simple-filter/14411/1 "2013-11-14T17:03:20Z")

</div>

Suppose I just want to get all record with "type" = 2 [integer]. What is the best way to write the query?  
Should it be something like  
"filtered": {  
"query": {  
" **match\_all": {}**  
},  
"filter": {  
term": {  
"type": 3  
}  
}  
}

or using constant\_score?

---

<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, 2:06am UTC](https://discuss.elastic.co/t/constant-score-vs-match-all-for-simple-filter/14411/2 "2017-07-06T02:06:58Z")

</div>


