lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Boolean query with 50,000 clauses! Possible? Scalable?
Date Tue, 28 Jul 2009 16:44:40 GMT
> > If so, how does Lucene handle the case where a book has several authors,
> > each with a name, a weight, etc..
> > How does one keep them "in sync", so that if I search for books that
> > have an author with first name "Robert" and who weighs more than 100 Kg,
> > I do not hit the ones that have a combination like this :
> > author #1 : Einstein, Albert, 101 Kg
> > author #2 : McNamara, Robert, 075 Kg
> 
> This is not so simple using this approach. You can only do it with one
> combined field containing the author and weight, but then you cannot use
> NumericRangeQuery and must write more complicated queries by adding a
> PositionIncrement/Offset to the terms created and correlate the author and
> weight using this in a SpanQuery.

In general you should be able to do this with SpanQueries if you correlate
the weight and names using offsets or positions.

But you must think about it longer, but it should work.

> But I understood the question different:
> "I want a
> query that gives every book document authored by people weighing more than
> 200lbs, with the ability of doing faceting and the likes."
> 
> In this case it is irrelevant which author weights the 200 lbs, there must
> be only one, so a NumericRange line
> NumericRangeQuery.newFloatRange(field,200.0f,null,true,true) would do it.
> 
> Uwe



Mime
View raw message