# Constant Score Query & Bool Query

**URL:** <https://discuss.elastic.co/t/constant-score-query-bool-query/18999>\
**Category:** Elasticsearch\
**Created:** [July 31, 2014, 8:45am UTC](https://discuss.elastic.co/t/constant-score-query-bool-query/18999 "2014-07-31T08:45:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kayngee](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kayngee](https://discuss.elastic.co/u/kayngee)\
**Post date:** [July 31, 2014, 8:45am UTC](https://discuss.elastic.co/t/constant-score-query-bool-query/18999/1 "2014-07-31T08:45:42Z")

</div>

Hi Guys,

Quick question regarding scoring when ConstantScoreQuery & Bool Query are  
used in conjunction

So here is the query

{

> ```
> "from": 0,
> 
> "size": 10,
> 
> "explain": false,
> 
> "sort": ["_score"],
> 
> "query": {
> 
> "filtered": {
> 
> "query": {
> 
> "bool": {
> 
> "should": [{
> 
> "constant_score": {
> 
> "query": {
> 
> "match": {
> 
> "_all": {
> 
> "query": "test"
> 
> }
> 
> }
> 
> },
> 
> "boost": 1.0
> 
> }
> 
> }, {
> 
> "constant_score": {
> 
> "query": {
> 
> "match": {
> 
> "_all": {
> 
> "query": "check"
> 
> }
> 
> }
> 
> },
> 
> "boost": 1.0
> 
> }
> 
> }]
> 
> },
> 
> "disable_coord": 1
> 
> },
> 
> "filter": [{
> 
> "or": [{
> 
> "query": {
> 
> "match": {
> 
> "_all": {
> 
> "query": "test"
> 
> }
> 
> }
> 
> }
> 
> }, {
> 
> "query": {
> 
> "match": {
> 
> "_all": {
> 
> "query": "check"
> 
> }
> 
> }
> 
> }
> 
> }]
> 
> }]
> 
> }
> 
> }
> 
> ```
> 
> }

Shouldn't the above query either return a score of either 1 OR 2 why is it  
returning score of lets say 1.4 if I am wrapping the sub queries with a  
constant score query?

Regards  
Shawn

--  
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/b749780a-23f3-4e1d-bdea-b6d59c9507e4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b749780a-23f3-4e1d-bdea-b6d59c9507e4%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:12am UTC](https://discuss.elastic.co/t/constant-score-query-bool-query/18999/2 "2017-07-06T01:12:02Z")

</div>


