lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Popovici <cristi.popov...@visionsr.com>
Subject Re: Find groups where at least one item matches a query
Date Sun, 05 Feb 2017 19:55:40 GMT
Doesn't seem to work - I'm doing a query like this and I get only one result

q=pathology:normal&group=true&group.field=groupId&*group.limit=2*

On Sun, Feb 5, 2017 at 7:20 PM, Nick Vasilyev <nick.vasilyev1@gmail.com>
wrote:

> Check out the group.limit argument.
>
> On Feb 5, 2017 12:10 PM, "Cristian Popovici" <cristi.popovici@visionsr.com
> >
> wrote:
>
> > Erick, thanks for you answer.
> >
> > Sorry - I forgot to mention that I do not know the group id when I
> perform
> > the query.
> > Grouping - I think - does not help for me as it filters out the documents
> > that do not meet the filter criteria.
> >
> > Example:
> > *q=pathology:Normal&group=true&group.field=groupId*  will miss out the
> > "pathology":
> > "Metastasis".
> >
> > I need to retrieve both documents in the same group even if only one
> meets
> > the search criteria.
> >
> > Thanks!
> >
> > On Sun, Feb 5, 2017 at 6:54 PM, Erick Erickson <erickerickson@gmail.com>
> > wrote:
> >
> > > Isn't this just "&fq=groupId:223"?
> > >
> > > Or do you mean you need multiple _groups_? In which case you can use
> > > grouping, see:
> > > https://cwiki.apache.org/confluence/display/solr/
> > > Collapse+and+Expand+Results
> > > and/or
> > > https://cwiki.apache.org/confluence/display/solr/Result+Grouping
> > >
> > > but do note there are some limitations in distributed mode.
> > >
> > > Best,
> > > Erick
> > >
> > > On Sun, Feb 5, 2017 at 1:49 AM, Cristian Popovici
> > > <cristi.popovici@visionsr.com> wrote:
> > > > Hi all,
> > > >
> > > > I'm new to Solr and I need a bit of help.
> > > >
> > > > I have a structure of documents indexed in Solr that are grouped
> > together
> > > > by a property. I need to retrieve all groups where at least one entry
> > in
> > > > the group matches a query.
> > > >
> > > > Example:
> > > > I have two documents indexed and both share the *groupId *property
> that
> > > > defines the grouping field.
> > > >
> > > > *{*
> > > > *        "groupId": "223",*
> > > > *        "modality": "Computed Tomography",*
> > > > *        "anatomy": "Subcutaneous fat",*
> > > > *        "pathology": "Metastasis",*
> > > > *}*
> > > >
> > > > *{*
> > > > *        "groupId": "223",*
> > > > *        "modality": "Computed Tomography",*
> > > > *        "anatomy": "Subcutaneous fat",*
> > > > *        "pathology": "Normal",*
> > > > *}*
> > > >
> > > > I need to retrieve both entries in the group when performing a query
> > > like:
> > > >
> > > > *(pathology:Normal)*
> > > > Is this possible in solr?
> > > >
> > > > Thanks!
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message