jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Brown <benjamin.br...@thisisnumero.com>
Subject Custom ScoreIterator - how do I implement?
Date Mon, 30 Mar 2009 09:08:20 GMT
Hi,

I have a tree of nodes and each node has a set of scoring criteria, e.g. most popular, most
rated, most recent etc. The criteria are not implemented as properties against the nodes,
i.e. the node guids are stored on a separate database with stats against them. The reason
it is like this is an architecture decision, since other parts of the system do not need to
know about jcr.

Implementing a class that extends the NodeIterator to use these stats (scores) is the easy
part, however I have no idea how to get jcr to use this implementation. Looking at the jcr
1.4 source I can see that the QueryResultImpl uses either of two hardcoded types of NodeIterator
in the private method getNodeIterator(), wherein it creates new instances at that point. There
seems to be no obvious option for the user to specify the type of iterator and although the
class is not final, I cannot override getNodeIterator() as it is private.

Can someone give me pointers on how to provide a custom node iterator? Also, can someone please
tell me why there are two ScoreNodeIterator interfaces and the difference between the jcr2spi
package and the core.query.lucene package? I think I should be using the jcr2spi interface
somewhere and not trying to fudge the existing jcr queryresultimpl into using my implementation
however Googling and looking at the jcr site and wiki have (not yet) yielded results.

Thanks,

Benjamin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message