I'm hoping someone can offer some insight into the FunctionQuery. I've just discovered this,
and I think it's exactly what I've been looking for, but I'm having some trouble getting it
to work. I can create and execute the query, but if I try to see the Explanation, I get an
java.lang.UnsupportedOperationException . Can someone show me where I'm going wrong?
Query query = parser.parse(newCriteria);
LinearFloatFunction lff = new LinearFloatFunction(new IntFieldSource("num"), 1.0f,
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 FunctionQuery with a Query in a BooleanQuery, based on some information I found
on this list. However, here's where I run into trouble:
//there's code here that executes the query and does other exciting things
ms.explain(bQ, hit.getId());
The ms is a MultiSearcher. I read that java.lang.UnsupportedOperationException is usually
a result of a query not being in it's rewritten form. Is that my problem here? Any help you
could offer would be greatly appreciated.
Thanks,
Ann
____________________________________________________________________________________
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/
|