there is a way, but it is not something that will be officially supported. There is an internal interface that exposes a getScore() method: o.a.j.core.query.lucene.ScoreNodeIterator. NodeIterator instances that are returned by jackrabbits QueryResult *currently* implement this interface.

so, you can do the following:

QueryResult results = ...
ScoreNodeIterator nodes = (ScoreNodeIterator) results.getNodes();
while (nodes.hasNext()) {
    float score = nodes.getScore();
    Node n = nodes.nextNode();
}

regards
 marcel

David Kennedy wrote:
Is it possible to get the score from the Query using the NodeIterator? It's very unfortunate and inefficient to have to convert from Row to Node and vice versa when we want the score in addition to the node structure.

David

Reply via email to