# "Sorting" with has\_child and custom\_score not working

**URL:** https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275
**Category:** Elasticsearch
**Created:** [June 5, 2013, 8:22am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275 "2013-06-05T08:22:13Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)
#### Post date: [June 5, 2013, 8:22am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/1 "2013-06-05T08:22:13Z")

</div>

> <https://gist.github.com/q42jaap/5712231>

I've recreated the example Martijn presented at #bbuzz and tried to make  
the sorting by price work.  
However, the scoring script doesn't seem to be working.

The individual scores for the product hits are just 1.0 and not related to  
the price of the offer...

What am I doing wrong here?

Jaap

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [June 5, 2013, 2:34pm UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/2 "2013-06-05T14:34:37Z")

</div>

Hi Jaap,

There is a mistake in my extra slide about child sorting. The score\_mode is  
by default none and scores aren't kept. I added an comment to your gist. I  
think it make sense to add `score_mode` min to this query (sorting by  
cheapest offer).

Martijn

On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> 
> I've recreated the example Martijn presented at #bbuzz and tried to make  
> the sorting by price work.  
> However, the scoring script doesn't seem to be working.
> 
> The individual scores for the product hits are just 1.0 and not related to  
> the price of the offer...
> 
> What am I doing wrong here?
> 
> Jaap
> 
> --  
> 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).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [June 5, 2013, 3:30pm UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/3 "2013-06-05T15:30:16Z")

</div>

Btw: I updated my slides.

On 5 June 2013 16:34, Martijn v Groningen [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)wrote:

> Hi Jaap,
> 
> There is a mistake in my extra slide about child sorting. The score\_mode  
> is by default none and scores aren't kept. I added an comment to your gist.  
> I think it make sense to add `score_mode` min to this query (sorting by  
> cheapest offer).
> 
> Martijn
> 
> On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> 
> > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > 
> > I've recreated the example Martijn presented at #bbuzz and tried to make  
> > the sorting by price work.  
> > However, the scoring script doesn't seem to be working.
> > 
> > The individual scores for the product hits are just 1.0 and not related  
> > to the price of the offer...
> > 
> > What am I doing wrong here?
> > 
> > Jaap
> > 
> > --  
> > 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).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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: ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)
#### Post date: [June 6, 2013, 7:53am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/4 "2013-06-06T07:53:42Z")

</div>

Hey Martijn,

I'm getting the following exception:  
QueryParsingException[[products] [has\_child] query does not support  
[score\_mode]]

I'm on version:

- version: {
  - number: 0.90.0
  - snapshot\_build: false  
}

Do I need to upgrade to get it to work?

Jaap Taal

[Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
30164662 ]

On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:

> Btw: I updated my slides.
> 
> On 5 June 2013 16:34, Martijn v Groningen [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)wrote:
> 
> > Hi Jaap,
> > 
> > There is a mistake in my extra slide about child sorting. The score\_mode  
> > is by default none and scores aren't kept. I added an comment to your gist.  
> > I think it make sense to add `score_mode` min to this query (sorting by  
> > cheapest offer).
> > 
> > Martijn
> > 
> > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > 
> > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > 
> > > I've recreated the example Martijn presented at #bbuzz and tried to make  
> > > the sorting by price work.  
> > > However, the scoring script doesn't seem to be working.
> > > 
> > > The individual scores for the product hits are just 1.0 and not related  
> > > to the price of the offer...
> > > 
> > > What am I doing wrong here?
> > > 
> > > Jaap
> > > 
> > > --  
> > > 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).
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, 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).

--  
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: ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)
#### Post date: [June 6, 2013, 7:59am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/5 "2013-06-06T07:59:41Z")

</div>

I upgraded to 0.90.1, and score\_type is now recognized. However I expected  
to be able to use "min" as a value, but I couldn't.  
The docs mention this, but not why the "min" value is not supported. So  
why's that (what's the technical reason behind it?)

In my case it's not difficult to negate the price value and use max.

Jaap Taal

[Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
30164662 ]

On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> Hey Martijn,
> 
> I'm getting the following exception:  
> QueryParsingException[[products] [has\_child] query does not support  
> [score\_mode]]
> 
> I'm on version:
> 
> - version: {
> - number: 0.90.0
> - snapshot\_build: false  
> }
> 
> Do I need to upgrade to get it to work?
> 
> Jaap Taal
> 
> [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> 30164662 ]
> 
> On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> 
> > Btw: I updated my slides.
> > 
> > On 5 June 2013 16:34, Martijn v Groningen [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)wrote:
> > 
> > > Hi Jaap,
> > > 
> > > There is a mistake in my extra slide about child sorting. The score\_mode  
> > > is by default none and scores aren't kept. I added an comment to your gist.  
> > > I think it make sense to add `score_mode` min to this query (sorting by  
> > > cheapest offer).
> > > 
> > > Martijn
> > > 
> > > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > 
> > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > 
> > > > I've recreated the example Martijn presented at #bbuzz and tried to  
> > > > make the sorting by price work.  
> > > > However, the scoring script doesn't seem to be working.
> > > > 
> > > > The individual scores for the product hits are just 1.0 and not related  
> > > > to the price of the offer...
> > > > 
> > > > What am I doing wrong here?
> > > > 
> > > > Jaap
> > > > 
> > > > --  
> > > > 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).
> > > 
> > > --  
> > > Met vriendelijke groet,
> > > 
> > > Martijn van Groningen
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, 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).

--  
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: ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)
#### Post date: [June 6, 2013, 8:01am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/6 "2013-06-06T08:01:20Z")

</div>

I mean sort\_mode of course

Jaap Taal

[Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
30164662 ]

On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> I upgraded to 0.90.1, and score\_type is now recognized. However I expected  
> to be able to use "min" as a value, but I couldn't.  
> The docs mention this, but not why the "min" value is not supported. So  
> why's that (what's the technical reason behind it?)
> 
> In my case it's not difficult to negate the price value and use max.
> 
> Jaap Taal
> 
> [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> 30164662 ]
> 
> On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> 
> > Hey Martijn,
> > 
> > I'm getting the following exception:  
> > QueryParsingException[[products] [has\_child] query does not support  
> > [score\_mode]]
> > 
> > I'm on version:
> > 
> > - version: {
> > - number: 0.90.0
> > - snapshot\_build: false  
> > }
> > 
> > Do I need to upgrade to get it to work?
> > 
> > Jaap Taal
> > 
> > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > 30164662 ]
> > 
> > On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > 
> > > Btw: I updated my slides.
> > > 
> > > On 5 June 2013 16:34, Martijn v Groningen \<[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)
> > > 
> > > > wrote:
> > > 
> > > > Hi Jaap,
> > > > 
> > > > There is a mistake in my extra slide about child sorting. The  
> > > > score\_mode is by default none and scores aren't kept. I added an comment to  
> > > > your gist. I think it make sense to add `score_mode` min to this query  
> > > > (sorting by cheapest offer).
> > > > 
> > > > Martijn
> > > > 
> > > > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > > 
> > > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > > 
> > > > > I've recreated the example Martijn presented at #bbuzz and tried to  
> > > > > make the sorting by price work.  
> > > > > However, the scoring script doesn't seem to be working.
> > > > > 
> > > > > The individual scores for the product hits are just 1.0 and not  
> > > > > related to the price of the offer...
> > > > > 
> > > > > What am I doing wrong here?
> > > > > 
> > > > > Jaap
> > > > > 
> > > > > --  
> > > > > 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).
> > > > 
> > > > --  
> > > > Met vriendelijke groet,
> > > > 
> > > > Martijn van Groningen
> > > 
> > > --  
> > > Met vriendelijke groet,
> > > 
> > > Martijn van Groningen
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > .  
> > > To unsubscribe from this group and all its topics, 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).

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [June 6, 2013, 8:13am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/7 "2013-06-06T08:13:54Z")

</div>

Hi Jaap,

The option `score_mode` was added in version 0.90.1 to be more consistent  
with the `nested` query. Versions before 0.90.1 only supported the  
`score_type` option. There is no technical reason and adding score\_mode  
option `min` shouldn't be that difficult.

Martijn

On 6 June 2013 10:01, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> I mean sort\_mode of course
> 
> Jaap Taal
> 
> [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> 30164662 ]
> 
> On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> 
> > I upgraded to 0.90.1, and score\_type is now recognized. However I  
> > expected to be able to use "min" as a value, but I couldn't.  
> > The docs mention this, but not why the "min" value is not supported. So  
> > why's that (what's the technical reason behind it?)
> > 
> > In my case it's not difficult to negate the price value and use max.
> > 
> > Jaap Taal
> > 
> > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > 30164662 ]
> > 
> > On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > 
> > > Hey Martijn,
> > > 
> > > I'm getting the following exception:  
> > > QueryParsingException[[products] [has\_child] query does not support  
> > > [score\_mode]]
> > > 
> > > I'm on version:
> > > 
> > > - version: {
> > > - number: 0.90.0
> > > - snapshot\_build: false  
> > > }
> > > 
> > > Do I need to upgrade to get it to work?
> > > 
> > > Jaap Taal
> > > 
> > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > 30164662 ]
> > > 
> > > On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > 
> > > > Btw: I updated my slides.
> > > > 
> > > > On 5 June 2013 16:34, Martijn v Groningen \<  
> > > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > > 
> > > > > Hi Jaap,
> > > > > 
> > > > > There is a mistake in my extra slide about child sorting. The  
> > > > > score\_mode is by default none and scores aren't kept. I added an comment to  
> > > > > your gist. I think it make sense to add `score_mode` min to this query  
> > > > > (sorting by cheapest offer).
> > > > > 
> > > > > Martijn
> > > > > 
> > > > > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > > > 
> > > > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > > > 
> > > > > > I've recreated the example Martijn presented at #bbuzz and tried to  
> > > > > > make the sorting by price work.  
> > > > > > However, the scoring script doesn't seem to be working.
> > > > > > 
> > > > > > The individual scores for the product hits are just 1.0 and not  
> > > > > > related to the price of the offer...
> > > > > > 
> > > > > > What am I doing wrong here?
> > > > > > 
> > > > > > Jaap
> > > > > > 
> > > > > > --  
> > > > > > 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).
> > > > > 
> > > > > --  
> > > > > Met vriendelijke groet,
> > > > > 
> > > > > Martijn van Groningen
> > > > 
> > > > --  
> > > > Met vriendelijke groet,
> > > > 
> > > > Martijn van Groningen
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to a topic in the  
> > > > Google Groups "elasticsearch" group.  
> > > > To unsubscribe from this topic, visit  
> > > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > > .  
> > > > To unsubscribe from this group and all its topics, 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).
> 
> --  
> 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).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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: ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)
#### Post date: [June 7, 2013, 9:43am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/8 "2013-06-07T09:43:57Z")

</div>

Hi Martijn,

I tried making the min option in ScoreType, and that seems to be working,  
but that only counts for children with the same parent. I would also need  
to make the whole query sort\_mode:min, which makes no sense at all in a  
full text context.

So I guess max with negative values automatically works for collapsing the  
child values because the whole query will also be scored with a max mode.

Jaap Taal

[Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
30164662 ]

On Thu, Jun 6, 2013 at 10:13 AM, Martijn v Groningen \<  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:

> Hi Jaap,
> 
> The option `score_mode` was added in version 0.90.1 to be more consistent  
> with the `nested` query. Versions before 0.90.1 only supported the  
> `score_type` option. There is no technical reason and adding score\_mode  
> option `min` shouldn't be that difficult.
> 
> Martijn
> 
> On 6 June 2013 10:01, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> 
> > I mean sort\_mode of course
> > 
> > Jaap Taal
> > 
> > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > 30164662 ]
> > 
> > On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > 
> > > I upgraded to 0.90.1, and score\_type is now recognized. However I  
> > > expected to be able to use "min" as a value, but I couldn't.  
> > > The docs mention this, but not why the "min" value is not supported. So  
> > > why's that (what's the technical reason behind it?)
> > > 
> > > In my case it's not difficult to negate the price value and use max.
> > > 
> > > Jaap Taal
> > > 
> > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > 30164662 ]
> > > 
> > > On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > 
> > > > Hey Martijn,
> > > > 
> > > > I'm getting the following exception:  
> > > > QueryParsingException[[products] [has\_child] query does not support  
> > > > [score\_mode]]
> > > > 
> > > > I'm on version:
> > > > 
> > > > - version: {
> > > > - number: 0.90.0
> > > > - snapshot\_build: false  
> > > > }
> > > > 
> > > > Do I need to upgrade to get it to work?
> > > > 
> > > > Jaap Taal
> > > > 
> > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > 30164662 ]
> > > > 
> > > > On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> > > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > > 
> > > > > Btw: I updated my slides.
> > > > > 
> > > > > On 5 June 2013 16:34, Martijn v Groningen \<  
> > > > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > > > 
> > > > > > Hi Jaap,
> > > > > > 
> > > > > > There is a mistake in my extra slide about child sorting. The  
> > > > > > score\_mode is by default none and scores aren't kept. I added an comment to  
> > > > > > your gist. I think it make sense to add `score_mode` min to this query  
> > > > > > (sorting by cheapest offer).
> > > > > > 
> > > > > > Martijn
> > > > > > 
> > > > > > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > > > > 
> > > > > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > > > > 
> > > > > > > I've recreated the example Martijn presented at #bbuzz and tried to  
> > > > > > > make the sorting by price work.  
> > > > > > > However, the scoring script doesn't seem to be working.
> > > > > > > 
> > > > > > > The individual scores for the product hits are just 1.0 and not  
> > > > > > > related to the price of the offer...
> > > > > > > 
> > > > > > > What am I doing wrong here?
> > > > > > > 
> > > > > > > Jaap
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).
> > > > > > 
> > > > > > --  
> > > > > > Met vriendelijke groet,
> > > > > > 
> > > > > > Martijn van Groningen
> > > > > 
> > > > > --  
> > > > > Met vriendelijke groet,
> > > > > 
> > > > > Martijn van Groningen
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to a topic in the  
> > > > > Google Groups "elasticsearch" group.  
> > > > > To unsubscribe from this topic, visit  
> > > > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > > > .  
> > > > > To unsubscribe from this group and all its topics, 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).
> > 
> > --  
> > 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).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, 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).

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [June 7, 2013, 12:19pm UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/9 "2013-06-07T12:19:35Z")

</div>

Makes sense what you're saying. The work around isn't perfect, but I think  
this is as good as it gets without the sorting by child fields support.

On 7 June 2013 11:43, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:

> Hi Martijn,
> 
> I tried making the min option in ScoreType, and that seems to be working,  
> but that only counts for children with the same parent. I would also need  
> to make the whole query sort\_mode:min, which makes no sense at all in a  
> full text context.
> 
> So I guess max with negative values automatically works for collapsing the  
> child values because the whole query will also be scored with a max mode.
> 
> Jaap Taal
> 
> [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> 30164662 ]
> 
> On Thu, Jun 6, 2013 at 10:13 AM, Martijn v Groningen \<  
> [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> 
> > Hi Jaap,
> > 
> > The option `score_mode` was added in version 0.90.1 to be more consistent  
> > with the `nested` query. Versions before 0.90.1 only supported the  
> > `score_type` option. There is no technical reason and adding score\_mode  
> > option `min` shouldn't be that difficult.
> > 
> > Martijn
> > 
> > On 6 June 2013 10:01, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > 
> > > I mean sort\_mode of course
> > > 
> > > Jaap Taal
> > > 
> > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > 30164662 ]
> > > 
> > > On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > 
> > > > I upgraded to 0.90.1, and score\_type is now recognized. However I  
> > > > expected to be able to use "min" as a value, but I couldn't.  
> > > > The docs mention this, but not why the "min" value is not supported. So  
> > > > why's that (what's the technical reason behind it?)
> > > > 
> > > > In my case it's not difficult to negate the price value and use max.
> > > > 
> > > > Jaap Taal
> > > > 
> > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > 30164662 ]
> > > > 
> > > > On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > > 
> > > > > Hey Martijn,
> > > > > 
> > > > > I'm getting the following exception:  
> > > > > QueryParsingException[[products] [has\_child] query does not support  
> > > > > [score\_mode]]
> > > > > 
> > > > > I'm on version:
> > > > > 
> > > > > - version: {
> > > > > - number: 0.90.0
> > > > > - snapshot\_build: false  
> > > > > }
> > > > > 
> > > > > Do I need to upgrade to get it to work?
> > > > > 
> > > > > Jaap Taal
> > > > > 
> > > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > > 30164662 ]
> > > > > 
> > > > > On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> > > > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > > > 
> > > > > > Btw: I updated my slides.
> > > > > > 
> > > > > > On 5 June 2013 16:34, Martijn v Groningen \<  
> > > > > > [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:
> > > > > > 
> > > > > > > Hi Jaap,
> > > > > > > 
> > > > > > > There is a mistake in my extra slide about child sorting. The  
> > > > > > > score\_mode is by default none and scores aren't kept. I added an comment to  
> > > > > > > your gist. I think it make sense to add `score_mode` min to this query  
> > > > > > > (sorting by cheapest offer).
> > > > > > > 
> > > > > > > Martijn
> > > > > > > 
> > > > > > > On 5 June 2013 10:22, Jaap Taal [jaap@q42.nl](mailto:jaap@q42.nl) wrote:
> > > > > > > 
> > > > > > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > > > > > 
> > > > > > > > I've recreated the example Martijn presented at #bbuzz and tried to  
> > > > > > > > make the sorting by price work.  
> > > > > > > > However, the scoring script doesn't seem to be working.
> > > > > > > > 
> > > > > > > > The individual scores for the product hits are just 1.0 and not  
> > > > > > > > related to the price of the offer...
> > > > > > > > 
> > > > > > > > What am I doing wrong here?
> > > > > > > > 
> > > > > > > > Jaap
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).
> > > > > > > 
> > > > > > > --  
> > > > > > > Met vriendelijke groet,
> > > > > > > 
> > > > > > > Martijn van Groningen
> > > > > > 
> > > > > > --  
> > > > > > Met vriendelijke groet,
> > > > > > 
> > > > > > Martijn van Groningen
> > > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to a topic in  
> > > > > > the Google Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this topic, visit  
> > > > > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > > > > .  
> > > > > > To unsubscribe from this group and all its topics, 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).
> > > 
> > > --  
> > > 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).
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, 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).
> 
> --  
> 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).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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: ![Derek\_Perkins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/derek_perkins/32/2049_2.png) [@Derek\_Perkins](https://discuss.elastic.co/u/Derek_Perkins)
#### Post date: [October 17, 2013, 3:15am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/10 "2013-10-17T03:15:05Z")

</div>

Martijn - Where can we find the updated copies of your slides?

On Friday, June 7, 2013 6:19:35 AM UTC-6, Martijn v Groningen wrote:

> Makes sense what you're saying. The work around isn't perfect, but I think  
> this is as good as it gets without the sorting by child fields support.
> 
> On 7 June 2013 11:43, Jaap Taal \<ja...@q42.nl \<javascript:\>\> wrote:
> 
> > Hi Martijn,
> > 
> > I tried making the min option in ScoreType, and that seems to be working,  
> > but that only counts for children with the same parent. I would also need  
> > to make the whole query sort\_mode:min, which makes no sense at all in a  
> > full text context.
> > 
> > So I guess max with negative values automatically works for collapsing  
> > the child values because the whole query will also be scored with a max  
> > mode.
> > 
> > Jaap Taal
> > 
> > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > 30164662 ]
> > 
> > On Thu, Jun 6, 2013 at 10:13 AM, Martijn v Groningen \<  
> > [martijn.v...@gmail.com](mailto:martijn.v...@gmail.com) \<javascript:\>\> wrote:
> > 
> > > Hi Jaap,
> > > 
> > > The option `score_mode` was added in version 0.90.1 to be more  
> > > consistent with the `nested` query. Versions before 0.90.1 only supported  
> > > the `score_type` option. There is no technical reason and adding score\_mode  
> > > option `min` shouldn't be that difficult.
> > > 
> > > Martijn
> > > 
> > > On 6 June 2013 10:01, Jaap Taal \<ja...@q42.nl \<javascript:\>\> wrote:
> > > 
> > > > I mean sort\_mode of course
> > > > 
> > > > Jaap Taal
> > > > 
> > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > 30164662 ]
> > > > 
> > > > On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal \<ja...@q42.nl \<javascript:\>\>wrote:
> > > > 
> > > > > I upgraded to 0.90.1, and score\_type is now recognized. However I  
> > > > > expected to be able to use "min" as a value, but I couldn't.  
> > > > > The docs mention this, but not why the "min" value is not supported.  
> > > > > So why's that (what's the technical reason behind it?)
> > > > > 
> > > > > In my case it's not difficult to negate the price value and use max.
> > > > > 
> > > > > Jaap Taal
> > > > > 
> > > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > > 30164662 ]
> > > > > 
> > > > > On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal \<ja...@q42.nl \<javascript:\>\>wrote:
> > > > > 
> > > > > > Hey Martijn,
> > > > > > 
> > > > > > I'm getting the following exception:  
> > > > > > QueryParsingException[[products] [has\_child] query does not support  
> > > > > > [score\_mode]]
> > > > > > 
> > > > > > I'm on version:
> > > > > > 
> > > > > > - version: {
> > > > > > - number: 0.90.0
> > > > > > - snapshot\_build: false  
> > > > > > }
> > > > > > 
> > > > > > Do I need to upgrade to get it to work?
> > > > > > 
> > > > > > Jaap Taal
> > > > > > 
> > > > > > [Q42 | tel 070 44523 42 | direct 070 44523 65 | [http://q42.nl](http://q42.nl) |  
> > > > > > Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK  
> > > > > > 30164662 ]
> > > > > > 
> > > > > > On Wed, Jun 5, 2013 at 5:30 PM, Martijn v Groningen \<  
> > > > > > [martijn.v...@gmail.com](mailto:martijn.v...@gmail.com) \<javascript:\>\> wrote:
> > > > > > 
> > > > > > > Btw: I updated my slides.
> > > > > > > 
> > > > > > > On 5 June 2013 16:34, Martijn v Groningen \<[martijn.v...@gmail.com](mailto:martijn.v...@gmail.com)\<javascript:\>
> > > > > > > 
> > > > > > > > wrote:
> > > > > > > 
> > > > > > > > Hi Jaap,
> > > > > > > > 
> > > > > > > > There is a mistake in my extra slide about child sorting. The  
> > > > > > > > score\_mode is by default none and scores aren't kept. I added an comment to  
> > > > > > > > your gist. I think it make sense to add `score_mode` min to this query  
> > > > > > > > (sorting by cheapest offer).
> > > > > > > > 
> > > > > > > > Martijn
> > > > > > > > 
> > > > > > > > On 5 June 2013 10:22, Jaap Taal \<ja...@q42.nl \<javascript:\>\> wrote:
> > > > > > > > 
> > > > > > > > > [Reproduction of sorting on child property (Note that you need 0.90.1) · GitHub](https://gist.github.com/q42jaap/5712231)
> > > > > > > > > 
> > > > > > > > > I've recreated the example Martijn presented at #bbuzz and tried  
> > > > > > > > > to make the sorting by price work.  
> > > > > > > > > However, the scoring script doesn't seem to be working.
> > > > > > > > > 
> > > > > > > > > The individual scores for the product hits are just 1.0 and not  
> > > > > > > > > related to the price of the offer...
> > > > > > > > > 
> > > > > > > > > What am I doing wrong here?
> > > > > > > > > 
> > > > > > > > > Jaap
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Met vriendelijke groet,
> > > > > > > > 
> > > > > > > > Martijn van Groningen
> > > > > > > 
> > > > > > > --  
> > > > > > > Met vriendelijke groet,
> > > > > > > 
> > > > > > > Martijn van Groningen
> > > > > > > 
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to a topic in  
> > > > > > > the Google Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this topic, visit  
> > > > > > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > > > > > .  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > Met vriendelijke groet,
> > > 
> > > Martijn van Groningen
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/GzM1EePOfn4/unsubscribe?hl=en-US)  
> > > .  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
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:12am UTC](https://discuss.elastic.co/t/sorting-with-has-child-and-custom-score-not-working/12275/11 "2017-07-06T02:12:00Z")

</div>


