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 Andy <an...@yahoo.com> on 2011/01/06 21:05:41 UTC

Will Result Grouping return documents that don't contain the specified "group.field"?

I want to group my results by a field named "group_id".

However, some of my documents don't contain the field "group_id". But I still want these documents to be returned as part of the results as long as they match the main query "q". 

Do I need to do anything to tell Solr that I want those documents?

Thanks.


      

Re: Will Result Grouping return documents that don't contain the specified "group.field"?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Thu, Jan 6, 2011 at 5:55 PM, Andy <an...@yahoo.com> wrote:
> So by default Solr will not return documents that don't contain the specified group.field?

Solr will.  Documents without a value for that field should be grouped
under the "null" value.

-Yonik
http://www.lucidimagination.com

Re: Will Result Grouping return documents that don't contain the specified "group.field"?

Posted by Andy <an...@yahoo.com>.
Is there anyway to configure Solr such that:

1) Documents that contain the specified "group.field" will be returned and grouped by "group.field",
AND
2) Documents that don't contain the specified "group.field" will just be returned as "normal" search results without any grouping

Any way to achieve that?

Thanks.

--- On Thu, 1/6/11, Erick Erickson <er...@gmail.com> wrote:

> From: Erick Erickson <er...@gmail.com>
> Subject: Re: Will Result Grouping return documents that don't contain the specified "group.field"?
> To: solr-user@lucene.apache.org
> Date: Thursday, January 6, 2011, 9:19 PM
> Correct. Given the fact that Solr
> only requires fields in documents where
> required="true", how could it? The behavior of "just put
> everything in a
> bucket that doesn't have field X" would produce some
> "interesting"
> results....
> 
> Best
> Erick
> 
> On Thu, Jan 6, 2011 at 5:55 PM, Andy <an...@yahoo.com>
> wrote:
> 
> > So by default Solr will not return documents that
> don't contain the
> > specified group.field?
> >
> >
> > --- On Thu, 1/6/11, Bob Sandiford <bo...@sirsidynix.com>
> wrote:
> >
> > > From: Bob Sandiford <bo...@sirsidynix.com>
> > > Subject: RE: Will Result Grouping return
> documents that don't contain the
> > specified "group.field"?
> > > To: "solr-user@lucene.apache.org"
> <so...@lucene.apache.org>
> > > Date: Thursday, January 6, 2011, 5:19 PM
> > > What if you put in a default value
> > > for the group_id field in the solr schema - would
> that work
> > > for you?  e.g. something like
> 'unknown'  Then
> > > you'll get all those with no original group_id
> value still
> > > grouped together, and you can figure out at
> display time
> > > what you want to do with them.
> > >
> > > Bob Sandiford | Lead Software Engineer |
> SirsiDynix
> > > P: 800.288.8020 X6943 | Bob.Sandiford@sirsidynix.com
> > > www.sirsidynix.com
> > >
> > >
> > > > -----Original Message-----
> > > > From: Andy [mailto:angelflow@yahoo.com]
> > > > Sent: Thursday, January 06, 2011 3:06 PM
> > > > To: solr-user@lucene.apache.org
> > > > Subject: Will Result Grouping return
> documents that
> > > don't contain the
> > > > specified "group.field"?
> > > >
> > > > I want to group my results by a field named
> > > "group_id".
> > > >
> > > > However, some of my documents don't contain
> the field
> > > "group_id". But I
> > > > still want these documents to be returned as
> part of
> > > the results as
> > > > long as they match the main query "q".
> > > >
> > > > Do I need to do anything to tell Solr that I
> want
> > > those documents?
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
> >
> 


      

Re: Will Result Grouping return documents that don't contain the specified "group.field"?

Posted by Erick Erickson <er...@gmail.com>.
Correct. Given the fact that Solr only requires fields in documents where
required="true", how could it? The behavior of "just put everything in a
bucket that doesn't have field X" would produce some "interesting"
results....

Best
Erick

On Thu, Jan 6, 2011 at 5:55 PM, Andy <an...@yahoo.com> wrote:

> So by default Solr will not return documents that don't contain the
> specified group.field?
>
>
> --- On Thu, 1/6/11, Bob Sandiford <bo...@sirsidynix.com> wrote:
>
> > From: Bob Sandiford <bo...@sirsidynix.com>
> > Subject: RE: Will Result Grouping return documents that don't contain the
> specified "group.field"?
> > To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> > Date: Thursday, January 6, 2011, 5:19 PM
> > What if you put in a default value
> > for the group_id field in the solr schema - would that work
> > for you?  e.g. something like 'unknown'  Then
> > you'll get all those with no original group_id value still
> > grouped together, and you can figure out at display time
> > what you want to do with them.
> >
> > Bob Sandiford | Lead Software Engineer | SirsiDynix
> > P: 800.288.8020 X6943 | Bob.Sandiford@sirsidynix.com
> > www.sirsidynix.com
> >
> >
> > > -----Original Message-----
> > > From: Andy [mailto:angelflow@yahoo.com]
> > > Sent: Thursday, January 06, 2011 3:06 PM
> > > To: solr-user@lucene.apache.org
> > > Subject: Will Result Grouping return documents that
> > don't contain the
> > > specified "group.field"?
> > >
> > > I want to group my results by a field named
> > "group_id".
> > >
> > > However, some of my documents don't contain the field
> > "group_id". But I
> > > still want these documents to be returned as part of
> > the results as
> > > long as they match the main query "q".
> > >
> > > Do I need to do anything to tell Solr that I want
> > those documents?
> > >
> > > Thanks.
> > >
> > >
> > >
> >
> >
> >
>
>
>
>

RE: Will Result Grouping return documents that don't contain the specified "group.field"?

Posted by Andy <an...@yahoo.com>.
So by default Solr will not return documents that don't contain the specified group.field?


--- On Thu, 1/6/11, Bob Sandiford <bo...@sirsidynix.com> wrote:

> From: Bob Sandiford <bo...@sirsidynix.com>
> Subject: RE: Will Result Grouping return documents that don't contain the specified "group.field"?
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Date: Thursday, January 6, 2011, 5:19 PM
> What if you put in a default value
> for the group_id field in the solr schema - would that work
> for you?  e.g. something like 'unknown'  Then
> you'll get all those with no original group_id value still
> grouped together, and you can figure out at display time
> what you want to do with them.
> 
> Bob Sandiford | Lead Software Engineer | SirsiDynix
> P: 800.288.8020 X6943 | Bob.Sandiford@sirsidynix.com
> www.sirsidynix.com 
> 
> 
> > -----Original Message-----
> > From: Andy [mailto:angelflow@yahoo.com]
> > Sent: Thursday, January 06, 2011 3:06 PM
> > To: solr-user@lucene.apache.org
> > Subject: Will Result Grouping return documents that
> don't contain the
> > specified "group.field"?
> > 
> > I want to group my results by a field named
> "group_id".
> > 
> > However, some of my documents don't contain the field
> "group_id". But I
> > still want these documents to be returned as part of
> the results as
> > long as they match the main query "q".
> > 
> > Do I need to do anything to tell Solr that I want
> those documents?
> > 
> > Thanks.
> > 
> > 
> > 
> 
> 
> 


      

RE: Will Result Grouping return documents that don't contain the specified "group.field"?

Posted by Bob Sandiford <bo...@sirsidynix.com>.
What if you put in a default value for the group_id field in the solr schema - would that work for you?  e.g. something like 'unknown'  Then you'll get all those with no original group_id value still grouped together, and you can figure out at display time what you want to do with them.

Bob Sandiford | Lead Software Engineer | SirsiDynix
P: 800.288.8020 X6943 | Bob.Sandiford@sirsidynix.com
www.sirsidynix.com 


> -----Original Message-----
> From: Andy [mailto:angelflow@yahoo.com]
> Sent: Thursday, January 06, 2011 3:06 PM
> To: solr-user@lucene.apache.org
> Subject: Will Result Grouping return documents that don't contain the
> specified "group.field"?
> 
> I want to group my results by a field named "group_id".
> 
> However, some of my documents don't contain the field "group_id". But I
> still want these documents to be returned as part of the results as
> long as they match the main query "q".
> 
> Do I need to do anything to tell Solr that I want those documents?
> 
> Thanks.
> 
> 
>