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 slevytam <de...@the10thfloor.com> on 2013/06/27 19:34:17 UTC

Field Query After Collapse.Field?

Hello,

I've struggling to find a way to query after collapse.field is performed and
I'm hoping someone can help.

I'm doing a multiple core(index) search which generates results that can
have varying fields.
ex.
entry_id, entry_starred
entry_id, entry_read

I perform a collapse.field on entry_id which yields:
ex. entry_id, entry_starred, entry_read

But if I try to do a fq on one of the fields
ex. fq=!entry_read:1

The fq is performed before the collapse leading to incorrect results.

Is there anyway to perform the field query after the results are collapsed?

Thanks,

slevytam



--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Field Query After Collapse.Field?

Posted by slevytam <de...@the10thfloor.com>.
Unfortunately not.  That would require an object for every single entry for
every single user.  

Generating millions of basically empty objects just for this query is likely
impossible.  

:(



--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691p4073976.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Field Query After Collapse.Field?

Posted by Bryan Bende <bb...@gmail.com>.
Can you just use two queries to achieve the desired results ?

Query1 to get all actions where !entry_read:1 for some range of rows (your
page size)
Query2 to get all the entries with an entry_id in the results of Query1

The second query would be very direct and only query for a set of entries
equal to your page size.


On Fri, Jun 28, 2013 at 12:51 PM, Erick Erickson <er...@gmail.com>wrote:

> Well, now I'm really puzzled. The link you referenced was from when
> grouping/field collapsing was under development. I did a quick look
> through the entire 4x code base fo "collapse" and there's no place
> I saw that looks like it accepts that parameter. Of course I may have
> just missed it.
>
> What version of Solr are you using? Have you done anything special
> to it? Can you cut/paste your response, or at least the relevant bits that
> show the effects of specifying collapse.field?
>
> Best
> Erick
>
>
> On Fri, Jun 28, 2013 at 12:19 PM, slevytam <development@the10thfloor.com
> >wrote:
>
> > Hi Erick,
> >
> > I actually did mean collapse.field, as per:
> >
> >
> http://blog.trifork.com/2009/10/20/result-grouping-field-collapsing-with-solr/
> >
> > On high level I am trying to avoid the use of a join between a list of
> > entries and a list of actions that users have performed on a entry (since
> > it's not supported by distributed search).
> >
> > So I have a list of entries
> > ie. entry_id, entry_content, etc
> >
> > And a list of actions users have performed on the entry
> > ie. entry_id, entry_read, entry_starred
> >
> > I'm trying to combine these for pagination purposes.  By doing a search
> for
> > entry_id across the two cores (indexes) and then doing a collapse.field,
> I
> > am able to get this nice list of results.  However, I cannot figure out a
> > way to then filter that list since q and fq happen before the collapse.
> >
> > Thanks,
> >
> > Shalom
> >
> >
> >
> > --
> > View this message in context:
> >
> http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691p4073928.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>

Re: Field Query After Collapse.Field?

Posted by slevytam <de...@the10thfloor.com>.
Hi Erick,

I have no idea how I managed to get that working.  I was messing around a
lot.  I may have added org.apache.solr.handler.component.CollapseComponent
to an older version :-  Unfortunately, I've formatted the server since to
try some other options.

I did find the official wiki page for the collapse.field feature.
http://wiki.apache.org/solr/FieldCollapsingUncommitted

I guess it was marked as duplicate for the 3.3 release; however, I cannot
find anyway to collapse fields with the current options. 
(http://wiki.apache.org/solr/FieldCollapsing)

Can you see anyway of doing this?

Thanks,

slevytam



--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691p4073972.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Field Query After Collapse.Field?

Posted by Erick Erickson <er...@gmail.com>.
Well, now I'm really puzzled. The link you referenced was from when
grouping/field collapsing was under development. I did a quick look
through the entire 4x code base fo "collapse" and there's no place
I saw that looks like it accepts that parameter. Of course I may have
just missed it.

What version of Solr are you using? Have you done anything special
to it? Can you cut/paste your response, or at least the relevant bits that
show the effects of specifying collapse.field?

Best
Erick


On Fri, Jun 28, 2013 at 12:19 PM, slevytam <de...@the10thfloor.com>wrote:

> Hi Erick,
>
> I actually did mean collapse.field, as per:
>
> http://blog.trifork.com/2009/10/20/result-grouping-field-collapsing-with-solr/
>
> On high level I am trying to avoid the use of a join between a list of
> entries and a list of actions that users have performed on a entry (since
> it's not supported by distributed search).
>
> So I have a list of entries
> ie. entry_id, entry_content, etc
>
> And a list of actions users have performed on the entry
> ie. entry_id, entry_read, entry_starred
>
> I'm trying to combine these for pagination purposes.  By doing a search for
> entry_id across the two cores (indexes) and then doing a collapse.field, I
> am able to get this nice list of results.  However, I cannot figure out a
> way to then filter that list since q and fq happen before the collapse.
>
> Thanks,
>
> Shalom
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691p4073928.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Field Query After Collapse.Field?

Posted by slevytam <de...@the10thfloor.com>.
Hi Erick,

I actually did mean collapse.field, as per:
http://blog.trifork.com/2009/10/20/result-grouping-field-collapsing-with-solr/

On high level I am trying to avoid the use of a join between a list of
entries and a list of actions that users have performed on a entry (since
it's not supported by distributed search).

So I have a list of entries
ie. entry_id, entry_content, etc

And a list of actions users have performed on the entry
ie. entry_id, entry_read, entry_starred

I'm trying to combine these for pagination purposes.  By doing a search for
entry_id across the two cores (indexes) and then doing a collapse.field, I
am able to get this nice list of results.  However, I cannot figure out a
way to then filter that list since q and fq happen before the collapse.

Thanks,

Shalom



--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691p4073928.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Field Query After Collapse.Field?

Posted by Erick Erickson <er...@gmail.com>.
bq: Is there anyway to perform the field query after the results are
collapsed?

I'm not quite sure what you mean here. The intent of fq
clauses it that they apply to the entire query before
anything else, including field collapsing (and I'm
assuming you mean group.field, not collapse.field)

What's the higher-level use-case you're trying to satisfy?

Best
Erick


On Thu, Jun 27, 2013 at 1:34 PM, slevytam <de...@the10thfloor.com>wrote:

> Hello,
>
> I've struggling to find a way to query after collapse.field is performed
> and
> I'm hoping someone can help.
>
> I'm doing a multiple core(index) search which generates results that can
> have varying fields.
> ex.
> entry_id, entry_starred
> entry_id, entry_read
>
> I perform a collapse.field on entry_id which yields:
> ex. entry_id, entry_starred, entry_read
>
> But if I try to do a fq on one of the fields
> ex. fq=!entry_read:1
>
> The fq is performed before the collapse leading to incorrect results.
>
> Is there anyway to perform the field query after the results are collapsed?
>
> Thanks,
>
> slevytam
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Field-Query-After-Collapse-Field-tp4073691.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>