lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Annona Keene <>
Subject Re: Explanation from FunctionQuery
Date Fri, 06 Apr 2007 13:49:40 GMT
Ok, glossing over some of the details was not the best idea. ms is a MultiSearcher in that
it's something I wrote that extends MultiSearcher.  And this part I should have mentioned
before, the explain method being called is the one in So
explain is 

  public Explanation explain(Query query, int doc) throws IOException {
    return explain(createWeight(query), doc);

I've verified that I am in fact calling the explain method that I think I am. Here's the full
stack trace:

    at com.testing.documentationsearch.Test.main(

So we reach a problem at extractTerms.  I get an explanation no problem if I do not include
the FunctionQuery in my BooleanQuery, so I can't see how this isn't related in some way to
FunctionQuery.  Stepping through my code, I can see that the extractTerms in BooleanQuery
public void extractTerms(Set terms) {
      for (Iterator i = clauses.iterator(); i.hasNext();) {
          BooleanClause clause = (BooleanClause);

goes swimmingly until the clause is the FunctionQuery clause.  extractTerms is being called
on LinearFloatFunction:1.0*float(int(num))+1.0)^1.0, and that is where the UnsupportedOperationException

So it seems to me like there's something simple here I'm missing. I've used the FunctionQuery
as part of a BooleanQuery, which is the advice I found searching this list. Am I not using
it correctly in the BooleanQuery? Here is the code I sent previously: 

           Query query = parser.parse(newCriteria);

            LinearFloatFunction lff = new LinearFloatFunction(new IntFieldSource("num"), 1.0f,
            FunctionQuery fQ = new FunctionQuery(lff);
            BooleanQuery bQ = new BooleanQuery();
            bQ.add(query, BooleanClause.Occur.MUST);
            bQ.add(fQ, BooleanClause.Occur.SHOULD); 

I'm using the version of FunctionQuery from the JIRA attachment.

I appreciate your input, and I would be very grateful for any other insight you could offer.
I am eager to get this working!

Thanks again,

----- Original Message ----
From: Chris Hostetter <>
Sent: Thursday, April 5, 2007 4:58:30 PM
Subject: Re: Explanation from FunctionQuery

1) which version of FunctionQuery are you using (from the solr repository
or from a Jira issue attachment?)
2) what is hte full stacktrace? (ie: which function/line is throwing the

FunctionQuery supports explain just fine, not sure why you'd have
problems, oh wait ... i see exactly what hte problem is...

: The ms is a MultiSearcher.  I read that

...this is the implemnetation for MultiSearcher...

    public Explanation explain(Weight weight,int doc) {
      throw new UnsupportedOperationException();
    }'s got nothing to do with FunctionQuery.


To unsubscribe, e-mail:
For additional commands, e-mail:

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message