lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Weiss (JIRA)" <>
Subject [jira] [Commented] (SOLR-10521) sort by string field of the nested child when searching with {!parent}
Date Thu, 27 Apr 2017 22:28:04 GMT


Stephen Weiss commented on SOLR-10521:

I'm thinking about how I would use this.  And I do think it will probably come up.  Most likely,
I will want to both sort on a child (or grandchild, etc) field, and I will want to actually
know what was in that field. 


a) It's important to include that extra $q parameter - don't assume there is only one level
of children.
b) Would it perhaps make more sense, and be easier on the QueryComponent, if you could just
include arbitrary child / grandchild field values in the parent result set (perhaps, appearing
as a multi-valued field?)  If you did this, could you then simply sort on the resulting field?
 Ie, instead of changing the syntax of sort, allow child fields to be added to the response,
and then sort them using the normal mechanism.  I feel like it would be easier to modify the
"fl" parameter because there's already a bracket syntax there (for example, for [docid]).
 Or maybe this already exists and I'm not aware of it?  Something like fl=id,name,[!childfield=price_that_day
object_type=sku_history price]  and then sort=price_that_day desc?  Actually, now that you
mention it, I think we do have a ticket in the backlog that this feature would actually make

> sort by string field of the nested child when searching with {!parent}
> ----------------------------------------------------------------------
>                 Key: SOLR-10521
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Mikhail Khludnev
>         Attachments: SOLR-10521.patch, SOLR-10521.patch, SOLR-10521.patch, SOLR-10521.patch,
> The idea is to integrate Lucene's {{ToParentBlockJoinSortField}} 
> The approach to hookup -it- is -a little bit tricky-:
> -{{sort=\{!childfield bjq=$q field=COLOR_s}desc}}- {{sort=\childfield(COLOR_s,&q)
> the question no.1 wdyt about the syntax? 
> internally it creates a function query with valueSource which produces {{ToParentBlockJoinSortField}}

> The main challenge is picking Solr field type from  {{ToParentBlockJoinSortField}}, because
as-is it's broken on {{mergeIds}} - ByteRefs need to be properly marshaled and unmarshalled
by a field type from the child scope. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message