You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Roopa Rao <ro...@gmail.com> on 2021/04/29 19:52:41 UTC

childFilter Solr 6.6

Hi -
I am on version Solr 6.6 and using parent and child construct

Query as follows:
 [child parentFilter='field1:value1' childFilter='((field1:(value1)) AND
({!terms f=field2}value2))' limit=1]

Here I want to sort this children by field3 and return only the top 1
element (hence limit=1) . Is there a way to do this?

I notice that when the children are returned, it is being returned in the
order it was indexed. Is this guaranteed?
If it is going to return the order in which is indexed that will work in my
case too, as I index the field3 data in the order which it should be shown.

Thanks,
Roopa

Re: childFilter Solr 6.6

Posted by David Smiley <ds...@apache.org>.
Hi,
childFilter is guaranteed to return the documents in the order it was
provided to Solr.

If you want to sort or do other interesting things, consider [subQuery]

~ David Smiley
Apache Lucene/Solr Search Developer
http://www.linkedin.com/in/davidwsmiley


On Thu, Apr 29, 2021 at 3:55 PM Roopa Rao <ro...@gmail.com> wrote:

> Hi -
> I am on version Solr 6.6 and using parent and child construct
>
> Query as follows:
>  [child parentFilter='field1:value1' childFilter='((field1:(value1)) AND
> ({!terms f=field2}value2))' limit=1]
>
> Here I want to sort this children by field3 and return only the top 1
> element (hence limit=1) . Is there a way to do this?
>
> I notice that when the children are returned, it is being returned in the
> order it was indexed. Is this guaranteed?
> If it is going to return the order in which is indexed that will work in my
> case too, as I index the field3 data in the order which it should be shown.
>
> Thanks,
> Roopa
>