[KinoSearch] HeatMap->hot_to_cold
webmasters at ctosonline.org
webmasters at ctosonline.org
Wed May 6 12:34:35 PDT 2009
On May 5, 2009, at 10:55 PM, Marvin Humphrey wrote:
> 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.
No problem. BTW, what is ‘real-time indexing’? If it is what I think
it is, I may be able to use it. (One problem I’ve come across is that
I can’t modify a document once I’ve added it to the index within the
same indexing session [or can I?].)
>
> 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;
Thank you. I’ve already written something similar, which should be
faster as there are fewer method calls:
my @locs = map [$_->get_offset,$_->get_weight], @{$heat_map-
>get_spans->to_perl};
@locs = map $$_[0], sort { $$b[1] <=> $$a[1] } @locs;
Father Chrysostomos
More information about the kinosearch
mailing list