On Thu, Apr 19, 2012 at 1:34 PM, Robert Muir <rcm...@gmail.com> wrote: > On Thu, Apr 19, 2012 at 1:26 PM, Benson Margulies <bimargul...@gmail.com> > wrote: >> I am trying to solve a problem using DisjunctionMaxQuery. >> >> >> Consider a query like: >> >> a:b OR c:d OR e:f OR ... >> name:richard OR name:dick OR name:dickie OR name:rich ... >> >> At most, one of the richard names matches. So the match score gets >> dragged down by the long list of things that don't match, as the list >> can get quite long. >> >> It seemed to me, upon reading the documentation, that I could cure >> this problem by creating a query tree that used DisjunctionMaxQuery >> around all those nicknames. However, when I built a boolean query that >> had, as a clause, a DisjunctionMaxQuery in the place of a pile of >> these individual Term queries, the score and the explanation did not >> change at all -- in particular, the coord term shows the same number >> of total terms. So it looks as if the children of the disjunction >> still count. >> >> Is there a way to control that term? Or a better way to express this? >> Thinking SQL for a moment, what I'm trying to express is >> >> name IN (richard, dick, dickie, rich) >> > > I think you just want to disable coord() here? You can do this for > that particular boolean query by passing true to the ctor: > > public BooleanQuery(boolean disableCoord)
Rob, How do nested queries work with respect to this? If I build a boolean query one of whose clauses is a BooleanQuery with coord turned off, does just the nested query insides get left out of 'coord'? If so, then your answer certainly seems to be what the doctor ordered. --benson > > -- > lucidimagination.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org