You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Gili Nachum <gi...@gmail.com> on 2015/11/29 13:44:13 UTC

Group by function in SolrCloud - when specifying exact shard with composite router (_route_ param)

Hi, I'm attempting result grouping
<https://cwiki.apache.org/confluence/display/solr/Result+Grouping> with
custom function in SolrCloud, by providing a _route_ , without success :~(

I know that group.func isn't supported in distributed searches, but in my
case *I only need the query to gather data from one core*: as I index with
"readerId" field as composite Id, then at query time I provide a
_route_=reader1! (aka shard.keys).
So I know all of my readerId documents are in the same shard.

*Any way to pull this off?*

Any comment on these leads?
1. Check the source code, as I guess there's something hardcoded that turns
off distribution if group.func is present, then I could turn of this
limitation - as I (think) know what I'm doing.
2.Implicit router?

Example query: ...&group=true&group.func=concat(timebox(time_tdt, 0),
stackId_s, ",")&_route_=reader1!

Example docs (note the composite id):
id reader_s time_tdt actor_s score_i stackId_s reader1!id1 reader1
2015-11-08T08:00:00Z actor1 3 stack1 reader3!id8 reader3
2015-11-10T22:01:00Z actor99 1 stack99

Re: Group by function in SolrCloud - when specifying exact shard with composite router (_route_ param)

Posted by Gili Nachum <gi...@gmail.com>.
Yeah, if I hit the right shard I get the right response back (regardless of
distrib=T/F).
But then, as you said, I'm not suppose to know which shard I hit (requires
knowing shard URL, then add replicas mess to that).
Bummer.

On Sun, Nov 29, 2015 at 8:55 PM, Erick Erickson <er...@gmail.com>
wrote:

> Not quite sure if I'm reading this right, but a non cloud request with
> &distrib=false might do the trick. Although you sake you're not
> supposed to know which shard, so I'm not sure this applies...
>
> On Sun, Nov 29, 2015 at 4:47 AM, Gili Nachum <gi...@gmail.com> wrote:
> > Adding:
> >
> >    1. Currently, when I query I only get results from the particular
> share
> >    I happened to hit (normally I'm not suppose to know which shard I
> hit).
> >    2. Running Solr 4.7.2
> >
> >
> > On Sun, Nov 29, 2015 at 2:44 PM, Gili Nachum <gi...@gmail.com>
> wrote:
> >
> >> Hi, I'm attempting result grouping
> >> <https://cwiki.apache.org/confluence/display/solr/Result+Grouping> with
> >> custom function in SolrCloud, by providing a _route_ , without success
> :~(
> >>
> >> I know that group.func isn't supported in distributed searches, but in
> my
> >> case *I only need the query to gather data from one core*: as I index
> >> with "readerId" field as composite Id, then at query time I provide a
> >> _route_=reader1! (aka shard.keys).
> >> So I know all of my readerId documents are in the same shard.
> >>
> >> *Any way to pull this off?*
> >>
> >> Any comment on these leads?
> >> 1. Check the source code, as I guess there's something hardcoded that
> >> turns off distribution if group.func is present, then I could turn of
> this
> >> limitation - as I (think) know what I'm doing.
> >> 2.Implicit router?
> >>
> >> Example query: ...&group=true&group.func=concat(timebox(time_tdt, 0),
> >> stackId_s, ",")&_route_=reader1!
> >>
> >> Example docs (note the composite id):
> >> id reader_s time_tdt actor_s score_i stackId_s reader1!id1 reader1
> >> 2015-11-08T08:00:00Z actor1 3 stack1 reader3!id8 reader3
> >> 2015-11-10T22:01:00Z actor99 1 stack99
> >>
>

Re: Group by function in SolrCloud - when specifying exact shard with composite router (_route_ param)

Posted by Erick Erickson <er...@gmail.com>.
Not quite sure if I'm reading this right, but a non cloud request with
&distrib=false might do the trick. Although you sake you're not
supposed to know which shard, so I'm not sure this applies...

On Sun, Nov 29, 2015 at 4:47 AM, Gili Nachum <gi...@gmail.com> wrote:
> Adding:
>
>    1. Currently, when I query I only get results from the particular share
>    I happened to hit (normally I'm not suppose to know which shard I hit).
>    2. Running Solr 4.7.2
>
>
> On Sun, Nov 29, 2015 at 2:44 PM, Gili Nachum <gi...@gmail.com> wrote:
>
>> Hi, I'm attempting result grouping
>> <https://cwiki.apache.org/confluence/display/solr/Result+Grouping> with
>> custom function in SolrCloud, by providing a _route_ , without success :~(
>>
>> I know that group.func isn't supported in distributed searches, but in my
>> case *I only need the query to gather data from one core*: as I index
>> with "readerId" field as composite Id, then at query time I provide a
>> _route_=reader1! (aka shard.keys).
>> So I know all of my readerId documents are in the same shard.
>>
>> *Any way to pull this off?*
>>
>> Any comment on these leads?
>> 1. Check the source code, as I guess there's something hardcoded that
>> turns off distribution if group.func is present, then I could turn of this
>> limitation - as I (think) know what I'm doing.
>> 2.Implicit router?
>>
>> Example query: ...&group=true&group.func=concat(timebox(time_tdt, 0),
>> stackId_s, ",")&_route_=reader1!
>>
>> Example docs (note the composite id):
>> id reader_s time_tdt actor_s score_i stackId_s reader1!id1 reader1
>> 2015-11-08T08:00:00Z actor1 3 stack1 reader3!id8 reader3
>> 2015-11-10T22:01:00Z actor99 1 stack99
>>

Re: Group by function in SolrCloud - when specifying exact shard with composite router (_route_ param)

Posted by Gili Nachum <gi...@gmail.com>.
Adding:

   1. Currently, when I query I only get results from the particular share
   I happened to hit (normally I'm not suppose to know which shard I hit).
   2. Running Solr 4.7.2


On Sun, Nov 29, 2015 at 2:44 PM, Gili Nachum <gi...@gmail.com> wrote:

> Hi, I'm attempting result grouping
> <https://cwiki.apache.org/confluence/display/solr/Result+Grouping> with
> custom function in SolrCloud, by providing a _route_ , without success :~(
>
> I know that group.func isn't supported in distributed searches, but in my
> case *I only need the query to gather data from one core*: as I index
> with "readerId" field as composite Id, then at query time I provide a
> _route_=reader1! (aka shard.keys).
> So I know all of my readerId documents are in the same shard.
>
> *Any way to pull this off?*
>
> Any comment on these leads?
> 1. Check the source code, as I guess there's something hardcoded that
> turns off distribution if group.func is present, then I could turn of this
> limitation - as I (think) know what I'm doing.
> 2.Implicit router?
>
> Example query: ...&group=true&group.func=concat(timebox(time_tdt, 0),
> stackId_s, ",")&_route_=reader1!
>
> Example docs (note the composite id):
> id reader_s time_tdt actor_s score_i stackId_s reader1!id1 reader1
> 2015-11-08T08:00:00Z actor1 3 stack1 reader3!id8 reader3
> 2015-11-10T22:01:00Z actor99 1 stack99
>