lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Keegan <peterlkee...@gmail.com>
Subject Re: Combining TopFieldCollector with custom Collector
Date Fri, 12 Mar 2010 14:54:15 GMT
Ok, thanks. I got stuck on trying to extend TopFieldDocCollector and didn't
notice it's also a TopDocsCollector. A couple of questions about Solr:

1. In Solr's DocSetDelegateCollector, a lot of code is duplicated. Why not
this:

public void collect(int doc) throws IOException {
  collector.collect(doc);
  super.collect(doc);
}

2. Why does acceptsDocsOutOfOrder return false if it's just collecting IDs?

Peter

On Fri, Mar 12, 2010 at 5:13 AM, Uwe Schindler <uwe@thetaphi.de> wrote:

> http://en.wikipedia.org/wiki/Delegation_pattern
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> > -----Original Message-----
> > From: Peter Keegan [mailto:peterlkeegan@gmail.com]
> > Sent: Thursday, March 11, 2010 9:41 PM
> > To: java-user@lucene.apache.org
> > Subject: Re: Combining TopFieldCollector with custom Collector
> >
> > Yes, but none of the other TFC methods would get called because none of
> > the
> > TFC classes can be extended. Or am I missing something?
> >
> > On Thu, Mar 11, 2010 at 3:37 PM, Michael McCandless <
> > lucene@mikemccandless.com> wrote:
> >
> > > In your collector, create the TFC and save it as tfc.
> > >
> > > Then in each of Collectors methods that you implement, do your own
> > > stuff (setting the bit) but also then call tfc.XXX (eg tfc.collect).
> > >
> > > That should work?
> > >
> > > Mike
> > >
> > > On Thu, Mar 11, 2010 at 2:57 PM, Peter Keegan
> > <peterlkeegan@gmail.com>
> > > wrote:
> > > > Yes. Could you give me a hint on how to delegate?
> > > >
> > > > On Thu, Mar 11, 2010 at 2:50 PM, Michael McCandless <
> > > > lucene@mikemccandless.com> wrote:
> > > >
> > > >> Can you make your own collector and then just delegate internally
> > to
> > > TFC?
> > > >>
> > > >> Mike
> > > >>
> > > >> On Thu, Mar 11, 2010 at 2:30 PM, Peter Keegan
> > <peterlkeegan@gmail.com>
> > > >> wrote:
> > > >> > Is it possible to issue a single search that combines a
> > > TopFieldCollector
> > > >> > (MultiComparatorScoringMaxScoreCollector) with a custom
> > Collector? The
> > > >> > custom Collector just collects the doc IDs into a BitSet (or
> > > DocIdSet).
> > > >> The
> > > >> > collect() methods of the various TopFieldCollectors cannot be
> > > overridden.
> > > >> >
> > > >> > Thanks,
> > > >> > Peter
> > > >> >
> > > >>
> > > >> ------------------------------------------------------------------
> > ---
> > > >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > >> For additional commands, e-mail: java-user-help@lucene.apache.org
> > > >>
> > > >>
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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