[KinoSearch] HeatMap->hot_to_cold

Marvin Humphrey marvin at rectangular.com
Tue May 5 22:55:52 PDT 2009


On Tue, May 05, 2009 at 08:42:14PM -0700, webmasters at ctosonline.org wrote:

> One quick question: Where did HeatMap->hot_to_cold go? Has it been  
> renamed or do I need a different approach? I had a look at HeatMap.c,  
> but my eyes started to glaze over....

HeatMap->hot_to_cold did not survive the port to C.  There were a number of
things about highlighting that went away during the transition because they
were either too Perl-specific or too tied to the innards of the old
implementation.

I had hoped to finish a C implementation that, while it might not match the
API of trunk circa r3122, would provide sufficient power in other ways.
That's how things worked out with the QueryParser, which was similarly awkward
to port to C, but is now much more extensible.  Indeed, the design sketched out
at <https://issues.apache.org/jira/browse/LUCENE-1522> should provide
excellent flexibility.

Unfortunately, I can't put working on the highlighter at the top of my
task list right now.  I have to finish real-time indexing first.

For a quick fix, I think you might be able to achieve the same ends as
hot_to_cold something like this:

    my $spans = $heat_map->get_spans->to_perl;
    my @hot_to_cold = map { $_->get_offset } 
        sort { $b->get_weight <=> $a->get_weight } @$spans;

However, it's been a little while since I worked on that code and I don't
remember all the subtleties.

Marvin Humphrey



More information about the kinosearch mailing list