lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Design guidance - search strategy
Date Fri, 05 Dec 2008 15:56:12 GMT
Yeah, I think we'll have to start paying the commission fee! ;)


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Erick Erickson <erickerickson@gmail.com>
> To: java-user@lucene.apache.org
> Sent: Friday, December 5, 2008 8:37:20 AM
> Subject: Re: Design guidance - search strategy
> 
> Glad it's working, but it's not my book, that's Erik Hatcher not
> Erick Erickson.....
> 
> Erik:
> Do I get a commission?
> 
> On Thu, Dec 4, 2008 at 9:48 PM, Ian Vink wrote:
> 
> > It works.
> > For those using Lucene.NET here is an example of a Filter that takes a list
> > of IDs for books:
> >
> >
> >    public class BookFilter: Filter
> >    {
> >        private readonly ListbookIDs;
> >
> >        public BookFilter(ListbookIDsToSearch)
> >        {
> >            bookIDs = bookIDsToSearch;
> >        }
> >
> >        public override BitArray Bits(IndexReader reader)
> >        {
> >            BitArray bits = new BitArray(50000);
> >            int[] docs = new int[1];
> >            int[] freqs = new int[1];
> >
> >            foreach (int bookID in bookIDs)
> >            {
> >                TermDocs termDocs = reader.TermDocs(new Term("id",
> > bookID.ToString()));
> >                int count = termDocs.Read(docs, freqs);
> >                if(count==1)
> >                    bits.Set(docs[0],true);
> >            }
> >            return bits;
> >        }
> >    }
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message