# Query Help

**URL:** <https://discuss.elastic.co/t/query-help/10756>\
**Category:** Elasticsearch\
**Created:** [February 15, 2013, 4:15pm UTC](https://discuss.elastic.co/t/query-help/10756 "2013-02-15T16:15:57Z")\
**Posts on this page:** 4\
**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:** [February 15, 2013, 4:15pm UTC](https://discuss.elastic.co/t/query-help/10756/1 "2013-02-15T16:15:57Z")

</div>

Is it possible to create a query which searches for different words in  
different properties of a document but gives a constant score irrelevant of  
where it was found. Basically i want to create something similar to this,  
but i can't find any similar examples

"constant\_score" :  
{  
"text":{  
"WorkExperience.Title":{  
"boost":18,  
"query":"developer",  
"type":"phrase"  
}  
},  
{  
"text":{  
"Course.Occupation":{  
"boost":18,  
"query":"developer",  
"type":"phrase"  
}  
}  
},  
"score":1  
}

"constant\_score" :  
{  
{  
"text":{  
"WorkExperience.Title":{  
"boost":16,  
"query":"engineer",  
"type":"phrase"  
}  
},  
"text":{  
"Project.Occupation":{  
"boost":16,  
"query":"engineer",  
"type":"phrase"  
}  
}  
},  
"score":1  
}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [February 15, 2013, 4:28pm UTC](https://discuss.elastic.co/t/query-help/10756/2 "2013-02-15T16:28:06Z")

</div>

To add some more feedback i added some more info below

{  
"bool" : {  
"should" : [  
"constant\_score" :  
{  
"text":{  
"WorkExperience.Title":{  
"query":"developer",  
"type":"phrase"  
}  
},  
{  
"text":{  
"Course.Occupation":{  
"query":"developer",  
"type":"phrase"  
}  
}  
},  
"boost" : 1.2  
},  
"constant\_score" :  
{  
{  
"match":{  
"WorkExperience.Title":{  
"query":"engineer",  
"type":"phrase"  
}  
},  
"match":{  
"Project.Occupation":{  
"query":"engineer",  
"type":"phrase"  
}  
}  
},  
"boost" : 1.2  
}  
]  
}  
}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [February 15, 2013, 4:46pm UTC](https://discuss.elastic.co/t/query-help/10756/3 "2013-02-15T16:46:40Z")

</div>

Found the solution dis\_max

On Friday, 15 February 2013 17:15:57 UTC+1, Shawn Ritchie wrote:

> Is it possible to create a query which searches for different words in  
> different properties of a document but gives a constant score irrelevant of  
> where it was found. Basically i want to create something similar to this,  
> but i can't find any similar examples
> 
> "constant\_score" :  
> {  
> "text":{  
> "WorkExperience.Title":{  
> "boost":18,  
> "query":"developer",  
> "type":"phrase"  
> }  
> },  
> {  
> "text":{  
> "Course.Occupation":{  
> "boost":18,  
> "query":"developer",  
> "type":"phrase"  
> }  
> }  
> },  
> "score":1  
> }
> 
> "constant\_score" :  
> {  
> {  
> "text":{  
> "WorkExperience.Title":{  
> "boost":16,  
> "query":"engineer",  
> "type":"phrase"  
> }  
> },  
> "text":{  
> "Project.Occupation":{  
> "boost":16,  
> "query":"engineer",  
> "type":"phrase"  
> }  
> }  
> },  
> "score":1  
> }

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:51am UTC](https://discuss.elastic.co/t/query-help/10756/4 "2017-07-06T02:51:19Z")

</div>


