This is not so simple and needs more programming experience and knowledge about the Lucene internals. They simpliest way (but works only in the not yet released Lucene 2.9) is to create a FilteredTermEnum (you iterate over all terms of the field in your index and pick all those up that match your criteria) and build a MultiTermQuery on top of it (override MultiTermQuery.getFilter()).
----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Edoardo Marcora [mailto:[email protected]] > Sent: Sunday, July 26, 2009 11:27 AM > To: [email protected] > Subject: RE: Boolean query with 50,000 clauses! Possible? Scalable? > > > Thanx for your prompt reply. Being a total noob on this, do you mind if I > ask > you how would I change this to a filter? > > Cheers, > > > Uwe Schindler wrote: > > > > I would change this to a Filter. BooleanQueries are not scalable this > way > > and will take very long time. > > > > ----- > > Uwe Schindler > > H.-H.-Meier-Allee 63, D-28213 Bremen > > http://www.thetaphi.de > > eMail: [email protected] > > > >> From: Edoardo Marcora [mailto:[email protected]] > >> Sent: Sunday, July 26, 2009 10:14 AM > >> To: [email protected] > >> Subject: Boolean query with 50,000 clauses! Possible? Scalable? > >> > >> > >> I am faced with the requirement for a boolean query composed of 50,000 > >> clauses (all of them directed at the same field) all OR'ed together. > >> > >> I know that maxClauseCount can be set arbitrarily, but I am wondering > >> whether this kind of query would chock and how scalable are this kind > of > >> queries (time/memory). > >> > >> Thank you in advance for your help and consideration > >> -- > >> View this message in context: http://www.nabble.com/Boolean-query-with- > >> 50%2C000-clauses%21-Possible--Scalable--tp24664839p24664839.html > >> Sent from the Lucene - General mailing list archive at Nabble.com. > > > > > > > > > > -- > View this message in context: http://www.nabble.com/Boolean-query-with- > 50%2C000-clauses%21-Possible--Scalable--tp24664839p24665291.html > Sent from the Lucene - General mailing list archive at Nabble.com.
