"Sorting" with has_child and custom_score not working

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

"Sorting" with has_child and custom_score not working

q42jaap
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

Martijn v Groningen
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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

Martijn v Groningen
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

q42jaap
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel 070 44523 42 | direct 070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

q42jaap
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 | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <[hidden email]> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel 070 44523 42 | direct 070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

q42jaap
I mean sort_mode of course

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


On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal <[hidden email]> 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 | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <[hidden email]> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel 070 44523 42 | direct 070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

Martijn v Groningen
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 <[hidden email]> wrote:
I mean sort_mode of course

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal <[hidden email]> 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 <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <[hidden email]> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

q42jaap
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 | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 10:13 AM, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
I mean sort_mode of course

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal <[hidden email]> 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 <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <[hidden email]> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

Martijn v Groningen
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 <[hidden email]> 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 <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | 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 <[hidden email]> 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 <[hidden email]> wrote:
I mean sort_mode of course

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal <[hidden email]> 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 <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | http://q42.nl | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <[hidden email]> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel <a href="tel:070%2044523%2042" value="+31704452342" target="_blank">070 44523 42 | direct <a href="tel:070%2044523%2065" value="+31704452365" target="_blank">070 44523 65 | 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 <[hidden email]> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <[hidden email]> 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 <[hidden email]> wrote:
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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit 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 [hidden email].
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: "Sorting" with has_child and custom_score not working

Derek Perkins
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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">ja...@...> 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 | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 10:13 AM, Martijn v Groningen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">martijn.v...@...> 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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">ja...@...> wrote:
I mean sort_mode of course

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


On Thu, Jun 6, 2013 at 9:59 AM, Jaap Taal <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">ja...@...> 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 | Waldorpstraat 17F, Den Haag | Oostelijke Handelskade 749, Amsterdam | KvK 30164662 ]


On Thu, Jun 6, 2013 at 9:53 AM, Jaap Taal <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">ja...@...> wrote:
Hey Martijn,

I'm getting the following exception:
QueryParsingException[[products] [has_child] query does not support [score_mode]]

I'm on version:
  • version: {
    • number0.90.0
    • snapshot_buildfalse
    }

Do I need to upgrade to get it to work?

Jaap Taal
 
[ Q42 | tel 070 44523 42 | direct 070 44523 65 | 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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">martijn.v...@...> wrote:
Btw: I updated my slides.


On 5 June 2013 16:34, Martijn v Groningen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">martijn.v...@...> 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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">ja...@...> wrote:
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">elasticsearc...@googlegroups.com.
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">elasticsearc...@googlegroups.com.
For more options, visit 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">elasticsearc...@googlegroups.com.
For more options, visit 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.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">elasticsearc...@googlegroups.com.
For more options, visit 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="vCMXGwCo8u0J">elasticsearc...@googlegroups.com.
For more options, visit 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.