# Constant boost for nested query

**URL:** <https://discuss.elastic.co/t/constant-boost-for-nested-query/9008>\
**Category:** Elasticsearch\
**Created:** [September 13, 2012, 2:44am UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008 "2012-09-13T02:44:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Yuska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_yuska/32/2717_2.png) [@Chris\_Yuska](https://discuss.elastic.co/u/Chris_Yuska)\
**Post date:** [September 13, 2012, 2:44am UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/1 "2012-09-13T02:44:44Z")

</div>

I have a Person object indexed with nested Work records. I want to search  
for the Work "title" and give an extra boost to Work records that match on  
title but are also still "current." My current query (shortened for the  
sake of this thread) looks like this:

query: {  
bool: {  
should: [  
{ term: { "works.title" : query } },  
{ term: { "works.current" : "true" } }  
]  
}  
}

There are some "must" terms in there, but the problem is that the  
works.current should only be applied to the works that are matches. In  
other words, a Person with 5 Works that are current but only 1 that matches  
the title query should score equally with a Person having 1 Work that is  
both a title match and current. Additionally, a Person with 1 Work that is  
both a title match and is current should score higher than a Person with 1  
Work that is only a title match (not current). Right now, the Person with  
more "current" matches scores higher, regardless of number of title matches  
or whether the current Works are the same Works that are title matches.

I'm lost as to how to enforce this score boosting only when the same nested  
object is already matched on. Any help?

Thanks.

--

---

<div class="post-metadata">

**Author:** ![phill](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@phill](https://discuss.elastic.co/u/phill)\
**Post date:** [September 14, 2012, 4:28pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/2 "2012-09-14T16:28:01Z")

</div>

On 9/12/2012 7:44 PM, Chris Yuska wrote:

> I have a Person object indexed with nested Work records. I want to  
> search for the Work "title" and give an extra boost to Work records  
> that match on title but are also still "current." My current query  
> (shortened for the sake of this thread) looks like this:
> 
> |  
> query:{  
> bool:{  
> should:[  
> {term:{"works.title":query }},  
> {term:{"works.current":"true"}}  
> ]  
> }  
> }  
> |  
> [...]  
> Right now, the Person with more "current" matches scores higher,  
> regardless of number of title matches or whether the current Works are  
> the same Works that are title matches.

I don't understand your whole problem, but a few things come to mind,  
the idea of turning off coordination within clauses of your bool query  
is one.  
Another is to consider moving the checking for matches to a filter, so  
that it doesn't effect the score.  
Try to also learn something about search explain, but that is hard since  
it's a bit cryptic particularly since it is at the Lucene level which  
might not correspond exactly to the ES query.

More fundamentally don't you want "must" for works.current? Should by  
itself is "one of these should match", and should with other musts is "0  
or more of these should match".  
Right now you are getting title match OR current matches aren't you?

-Paul

--

---

<div class="post-metadata">

**Author:** ![Chris\_Yuska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_yuska/32/2717_2.png) [@Chris\_Yuska](https://discuss.elastic.co/u/Chris_Yuska)\
**Post date:** [September 14, 2012, 5:17pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/3 "2012-09-14T17:17:10Z")

</div>

Thank you for the response. I probably should have disclosed more  
information about the nature of this query. This is actually a general  
query across all fields via a search box. Each Person has multiple other  
fields (name, location, etc.), as well as other nested objects. Currently,  
I just have all the fields we're trying to match in the bool query, along  
with the option minimum\_number\_should\_match: 1, which would incorrectly  
find works.current as a match, so I currently have the works.current term  
disabled.

After your comment and some more research, if I understand correctly, I  
should move all the fields I'm looking for a match on in this basic query  
to a bool filter (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
Then in the query, look for a match where works.current : true? The only  
issue I see there is keeping some sort of sane scoring that isn't totally  
dependent on works.current being true.

Thanks again.

On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:

> I don't understand your whole problem, but a few things come to mind,  
> the idea of turning off coordination within clauses of your bool query  
> is one.  
> Another is to consider moving the checking for matches to a filter, so  
> that it doesn't effect the score.  
> Try to also learn something about search explain, but that is hard since  
> it's a bit cryptic particularly since it is at the Lucene level which  
> might not correspond exactly to the ES query.
> 
> More fundamentally don't you want "must" for works.current? Should by  
> itself is "one of these should match", and should with other musts is "0  
> or more of these should match".  
> Right now you are getting title match OR current matches aren't you?
> 
> -Paul

--

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [September 15, 2012, 7:02pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/4 "2012-09-15T19:02:08Z")

</div>

Hi,

from reading your post I am not sure if you are actually using Nested Type  
or not. IMO this can be quite important in your case

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Regards,  
Lukas

On Fri, Sep 14, 2012 at 7:17 PM, Chris Yuska [chrisyuska@gmail.com](mailto:chrisyuska@gmail.com) wrote:

> Thank you for the response. I probably should have disclosed more  
> information about the nature of this query. This is actually a general  
> query across all fields via a search box. Each Person has multiple other  
> fields (name, location, etc.), as well as other nested objects. Currently,  
> I just have all the fields we're trying to match in the bool query, along  
> with the option minimum\_number\_should\_match: 1, which would incorrectly  
> find works.current as a match, so I currently have the works.current term  
> disabled.
> 
> After your comment and some more research, if I understand correctly, I  
> should move all the fields I'm looking for a match on in this basic query  
> to a bool filter (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
> Then in the query, look for a match where works.current : true? The only  
> issue I see there is keeping some sort of sane scoring that isn't totally  
> dependent on works.current being true.
> 
> Thanks again.
> 
> On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:
> 
> > I don't understand your whole problem, but a few things come to mind,  
> > the idea of turning off coordination within clauses of your bool query  
> > is one.  
> > Another is to consider moving the checking for matches to a filter, so  
> > that it doesn't effect the score.  
> > Try to also learn something about search explain, but that is hard since  
> > it's a bit cryptic particularly since it is at the Lucene level which  
> > might not correspond exactly to the ES query.
> > 
> > More fundamentally don't you want "must" for works.current? Should by  
> > itself is "one of these should match", and should with other musts is "0  
> > or more of these should match".  
> > Right now you are getting title match OR current matches aren't you?
> > 
> > -Paul
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Chris\_Yuska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_yuska/32/2717_2.png) [@Chris\_Yuska](https://discuss.elastic.co/u/Chris_Yuska)\
**Post date:** [September 17, 2012, 6:16pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/5 "2012-09-17T18:16:21Z")

</div>

Hi Lukas,

I am using the nested type. Any advice on what I'm doing wrong / need to  
do?

Thanks.

On Saturday, September 15, 2012 3:02:31 PM UTC-4, Lukáš Vlček wrote:

> Hi,
> 
> from reading your post I am not sure if you are actually using Nested Type  
> or not. IMO this can be quite important in your case  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)
> 
> Regards,  
> Lukas
> 
> On Fri, Sep 14, 2012 at 7:17 PM, Chris Yuska \<[chris...@gmail.com](mailto:chris...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Thank you for the response. I probably should have disclosed more  
> > information about the nature of this query. This is actually a general  
> > query across all fields via a search box. Each Person has multiple other  
> > fields (name, location, etc.), as well as other nested objects. Currently,  
> > I just have all the fields we're trying to match in the bool query, along  
> > with the option minimum\_number\_should\_match: 1, which would incorrectly  
> > find works.current as a match, so I currently have the works.current term  
> > disabled.
> > 
> > After your comment and some more research, if I understand correctly, I  
> > should move all the fields I'm looking for a match on in this basic query  
> > to a bool filter (  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
> > Then in the query, look for a match where works.current : true? The only  
> > issue I see there is keeping some sort of sane scoring that isn't totally  
> > dependent on works.current being true.
> > 
> > Thanks again.
> > 
> > On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:
> > 
> > > I don't understand your whole problem, but a few things come to mind,  
> > > the idea of turning off coordination within clauses of your bool query  
> > > is one.  
> > > Another is to consider moving the checking for matches to a filter, so  
> > > that it doesn't effect the score.  
> > > Try to also learn something about search explain, but that is hard since  
> > > it's a bit cryptic particularly since it is at the Lucene level which  
> > > might not correspond exactly to the ES query.
> > > 
> > > More fundamentally don't you want "must" for works.current? Should by  
> > > itself is "one of these should match", and should with other musts is "0  
> > > or more of these should match".  
> > > Right now you are getting title match OR current matches aren't you?
> > > 
> > > -Paul
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [September 17, 2012, 8:16pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/6 "2012-09-17T20:16:12Z")

</div>

Hi,

I tried to do full recreation. You can find it here:

> <https://gist.github.com/lukas-vlcek/3739469>

To me it seems to work correctly: Lukas and Karel scoring equally  
(regardless of Lukas having more current Nested objects then Karel) and Jan  
scoring less (he has no Nested object with current set to true).

Regards,  
Lukas

note to @karmiq, this example Karel is a different Karel 🙂

On Mon, Sep 17, 2012 at 8:16 PM, Chris Yuska [chrisyuska@gmail.com](mailto:chrisyuska@gmail.com) wrote:

> Hi Lukas,
> 
> I am using the nested type. Any advice on what I'm doing wrong / need to  
> do?
> 
> Thanks.
> 
> On Saturday, September 15, 2012 3:02:31 PM UTC-4, Lukáš Vlček wrote:
> 
> > Hi,
> > 
> > from reading your post I am not sure if you are actually using Nested  
> > Type or not. IMO this can be quite important in your case  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **guide/reference/mapping/** nested-type.html)[http://www.elasticsearch.org/guide/reference/mapping/nested-type.html](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)
> > 
> > Regards,  
> > Lukas
> > 
> > On Fri, Sep 14, 2012 at 7:17 PM, Chris Yuska [chris...@gmail.com](mailto:chris...@gmail.com) wrote:
> > 
> > > Thank you for the response. I probably should have disclosed more  
> > > information about the nature of this query. This is actually a general  
> > > query across all fields via a search box. Each Person has multiple other  
> > > fields (name, location, etc.), as well as other nested objects. Currently,  
> > > I just have all the fields we're trying to match in the bool query, along  
> > > with the option minimum\_number\_should\_match: 1, which would incorrectly  
> > > find works.current as a match, so I currently have the works.current term  
> > > disabled.
> > > 
> > > After your comment and some more research, if I understand correctly, I  
> > > should move all the fields I'm looking for a match on in this basic query  
> > > to a bool filter ([http://www.elasticsearch.org/](http://www.elasticsearch.org/)\*\*  
> > > guide/reference/query-dsl/\*\*bool-filter.html[http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
> > > Then in the query, look for a match where works.current : true? The only  
> > > issue I see there is keeping some sort of sane scoring that isn't totally  
> > > dependent on works.current being true.
> > > 
> > > Thanks again.
> > > 
> > > On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:
> > > 
> > > > I don't understand your whole problem, but a few things come to mind,  
> > > > the idea of turning off coordination within clauses of your bool query  
> > > > is one.  
> > > > Another is to consider moving the checking for matches to a filter, so  
> > > > that it doesn't effect the score.  
> > > > Try to also learn something about search explain, but that is hard  
> > > > since  
> > > > it's a bit cryptic particularly since it is at the Lucene level which  
> > > > might not correspond exactly to the ES query.
> > > > 
> > > > More fundamentally don't you want "must" for works.current? Should by  
> > > > itself is "one of these should match", and should with other musts is  
> > > > "0  
> > > > or more of these should match".  
> > > > Right now you are getting title match OR current matches aren't you?
> > > > 
> > > > -Paul
> > > 
> > > --
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Chris\_Yuska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_yuska/32/2717_2.png) [@Chris\_Yuska](https://discuss.elastic.co/u/Chris_Yuska)\
**Post date:** [September 17, 2012, 9:35pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/7 "2012-09-17T21:35:58Z")

</div>

Hey again,

Thanks again for your help. I have a couple issues with the recreation.  
First, the "dummy" match restricts the match to only the specified nested  
works. There is no "must" in my query, as it's really just searching that  
the search query "must match one of these fields." Which brings me to the  
second issue. the "name" field isn't being matched on in your recreation.  
I modified your gist a little bit to illustrate my intention (  
[Nested Query example for https://groups.google.com/d/topic/elasticsearch/PkZRPcq0YSk/discussion · GitHub](https://gist.github.com/3739681)).

It's incorrect as the "should match name" clause doesn't actually hit  
anything anyway, but I hope it shows what I'm trying to do at least. A  
search for "developer" should find all people with a job title of  
"developer" or name of "developer." If the person has a job title of  
"developer," then if that job is also current, it should get a boost in  
overall score. Does this make more sense? What I really don't know how to  
do is combine the nested query for "title" and "current" with the top-level  
query for "name."

On Monday, September 17, 2012 4:16:35 PM UTC-4, Lukáš Vlček wrote:

> Hi,
> 
> I tried to do full recreation. You can find it here:  
> [Nested Query example for https://groups.google.com/d/topic/elasticsearch/PkZRPcq0YSk/discussion · GitHub](https://gist.github.com/3739469)
> 
> To me it seems to work correctly: Lukas and Karel scoring equally  
> (regardless of Lukas having more current Nested objects then Karel) and Jan  
> scoring less (he has no Nested object with current set to true).
> 
> Regards,  
> Lukas
> 
> note to @karmiq, this example Karel is a different Karel 🙂
> 
> On Mon, Sep 17, 2012 at 8:16 PM, Chris Yuska \<[chris...@gmail.com](mailto:chris...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi Lukas,
> > 
> > I am using the nested type. Any advice on what I'm doing wrong / need to  
> > do?
> > 
> > Thanks.
> > 
> > On Saturday, September 15, 2012 3:02:31 PM UTC-4, Lukáš Vlček wrote:
> > 
> > > Hi,
> > > 
> > > from reading your post I am not sure if you are actually using Nested  
> > > Type or not. IMO this can be quite important in your case  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/mapping/)\*\*  
> > > nested-type.html[http://www.elasticsearch.org/guide/reference/mapping/nested-type.html](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)
> > > 
> > > Regards,  
> > > Lukas
> > > 
> > > On Fri, Sep 14, 2012 at 7:17 PM, Chris Yuska [chris...@gmail.com](mailto:chris...@gmail.com) wrote:
> > > 
> > > > Thank you for the response. I probably should have disclosed more  
> > > > information about the nature of this query. This is actually a general  
> > > > query across all fields via a search box. Each Person has multiple other  
> > > > fields (name, location, etc.), as well as other nested objects. Currently,  
> > > > I just have all the fields we're trying to match in the bool query, along  
> > > > with the option minimum\_number\_should\_match: 1, which would incorrectly  
> > > > find works.current as a match, so I currently have the works.current term  
> > > > disabled.
> > > > 
> > > > After your comment and some more research, if I understand correctly, I  
> > > > should move all the fields I'm looking for a match on in this basic query  
> > > > to a bool filter ([http://www.elasticsearch.org/](http://www.elasticsearch.org/)\*\*  
> > > > guide/reference/query-dsl/\*\*bool-filter.html[http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
> > > > Then in the query, look for a match where works.current : true? The only  
> > > > issue I see there is keeping some sort of sane scoring that isn't totally  
> > > > dependent on works.current being true.
> > > > 
> > > > Thanks again.
> > > > 
> > > > On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:
> > > > 
> > > > > I don't understand your whole problem, but a few things come to mind,
> > > > > 
> > > > > the idea of turning off coordination within clauses of your bool query  
> > > > > is one.  
> > > > > Another is to consider moving the checking for matches to a filter, so  
> > > > > that it doesn't effect the score.  
> > > > > Try to also learn something about search explain, but that is hard  
> > > > > since  
> > > > > it's a bit cryptic particularly since it is at the Lucene level which  
> > > > > might not correspond exactly to the ES query.
> > > > > 
> > > > > More fundamentally don't you want "must" for works.current? Should by  
> > > > > itself is "one of these should match", and should with other musts is  
> > > > > "0  
> > > > > or more of these should match".  
> > > > > Right now you are getting title match OR current matches aren't you?
> > > > > 
> > > > > -Paul
> > > > 
> > > > --
> > > 
> > > --

--

---

<div class="post-metadata">

**Author:** ![Chris\_Yuska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_yuska/32/2717_2.png) [@Chris\_Yuska](https://discuss.elastic.co/u/Chris_Yuska)\
**Post date:** [September 18, 2012, 11:33pm UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/8 "2012-09-18T23:33:56Z")

</div>

I just happened across this issue:  
[Expose matching nested docs to the query and sort · Issue #1383 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1383). Assuming it  
hasn't been added yet, it's what would essentially give me the visibility I  
need for my purposes.

On Monday, September 17, 2012 5:35:58 PM UTC-4, Chris Yuska wrote:

> Hey again,
> 
> Thanks again for your help. I have a couple issues with the recreation.  
> First, the "dummy" match restricts the match to only the specified nested  
> works. There is no "must" in my query, as it's really just searching that  
> the search query "must match one of these fields." Which brings me to the  
> second issue. the "name" field isn't being matched on in your recreation.  
> I modified your gist a little bit to illustrate my intention (  
> [Nested Query example for https://groups.google.com/d/topic/elasticsearch/PkZRPcq0YSk/discussion · GitHub](https://gist.github.com/3739681)).
> 
> It's incorrect as the "should match name" clause doesn't actually hit  
> anything anyway, but I hope it shows what I'm trying to do at least. A  
> search for "developer" should find all people with a job title of  
> "developer" or name of "developer." If the person has a job title of  
> "developer," then if that job is also current, it should get a boost in  
> overall score. Does this make more sense? What I really don't know how to  
> do is combine the nested query for "title" and "current" with the top-level  
> query for "name."
> 
> On Monday, September 17, 2012 4:16:35 PM UTC-4, Lukáš Vlček wrote:
> 
> > Hi,
> > 
> > I tried to do full recreation. You can find it here:  
> > [Nested Query example for https://groups.google.com/d/topic/elasticsearch/PkZRPcq0YSk/discussion · GitHub](https://gist.github.com/3739469)
> > 
> > To me it seems to work correctly: Lukas and Karel scoring equally  
> > (regardless of Lukas having more current Nested objects then Karel) and Jan  
> > scoring less (he has no Nested object with current set to true).
> > 
> > Regards,  
> > Lukas
> > 
> > note to @karmiq, this example Karel is a different Karel 🙂
> > 
> > On Mon, Sep 17, 2012 at 8:16 PM, Chris Yuska [chris...@gmail.com](mailto:chris...@gmail.com) wrote:
> > 
> > > Hi Lukas,
> > > 
> > > I am using the nested type. Any advice on what I'm doing wrong / need  
> > > to do?
> > > 
> > > Thanks.
> > > 
> > > On Saturday, September 15, 2012 3:02:31 PM UTC-4, Lukáš Vlček wrote:
> > > 
> > > > Hi,
> > > > 
> > > > from reading your post I am not sure if you are actually using Nested  
> > > > Type or not. IMO this can be quite important in your case  
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/mapping/)\*\*  
> > > > nested-type.html[http://www.elasticsearch.org/guide/reference/mapping/nested-type.html](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)
> > > > 
> > > > Regards,  
> > > > Lukas
> > > > 
> > > > On Fri, Sep 14, 2012 at 7:17 PM, Chris Yuska [chris...@gmail.com](mailto:chris...@gmail.com)wrote:
> > > > 
> > > > > Thank you for the response. I probably should have disclosed more  
> > > > > information about the nature of this query. This is actually a general  
> > > > > query across all fields via a search box. Each Person has multiple other  
> > > > > fields (name, location, etc.), as well as other nested objects. Currently,  
> > > > > I just have all the fields we're trying to match in the bool query, along  
> > > > > with the option minimum\_number\_should\_match: 1, which would incorrectly  
> > > > > find works.current as a match, so I currently have the works.current term  
> > > > > disabled.
> > > > > 
> > > > > After your comment and some more research, if I understand correctly,  
> > > > > I should move all the fields I'm looking for a match on in this basic query  
> > > > > to a bool filter ([http://www.elasticsearch.org/](http://www.elasticsearch.org/)\*\*  
> > > > > guide/reference/query-dsl/\*\*bool-filter.html[http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html))?  
> > > > > Then in the query, look for a match where works.current : true? The only  
> > > > > issue I see there is keeping some sort of sane scoring that isn't totally  
> > > > > dependent on works.current being true.
> > > > > 
> > > > > Thanks again.
> > > > > 
> > > > > On Friday, September 14, 2012 12:27:35 PM UTC-4, P Hill wrote:
> > > > > 
> > > > > > I don't understand your whole problem, but a few things come to mind,
> > > > > > 
> > > > > > the idea of turning off coordination within clauses of your bool  
> > > > > > query  
> > > > > > is one.  
> > > > > > Another is to consider moving the checking for matches to a filter,  
> > > > > > so  
> > > > > > that it doesn't effect the score.  
> > > > > > Try to also learn something about search explain, but that is hard  
> > > > > > since  
> > > > > > it's a bit cryptic particularly since it is at the Lucene level which  
> > > > > > might not correspond exactly to the ES query.
> > > > > > 
> > > > > > More fundamentally don't you want "must" for works.current? Should  
> > > > > > by  
> > > > > > itself is "one of these should match", and should with other musts is  
> > > > > > "0  
> > > > > > or more of these should match".  
> > > > > > Right now you are getting title match OR current matches aren't you?
> > > > > > 
> > > > > > -Paul
> > > > > 
> > > > > --
> > > > 
> > > > --

--

---

<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, 3:12am UTC](https://discuss.elastic.co/t/constant-boost-for-nested-query/9008/9 "2017-07-06T03:12:25Z")

</div>


