[KinoSearch] Numeric field types
Marvin Humphrey
marvin at rectangular.com
Mon Jun 29 16:47:17 PDT 2009
Greets,
KinoSearch 0.30_02 is primarily a bugfix release, but it contains some
interesting new undocumented classes: Int32Type, Int64Type, Float32Type and
Float64Type.
I'd hoped to make those public in 0.30_02; however, it turned out to be too
much work up front to get binary data through the present indexing chain and
into the lexicons, so those field types cannot be indexed just yet -- and I
didn't want to expose public APIs via POD/search.cpan.org/etc until that was
possible.
Nevertheless, these new field types can be stored and, most importantly, sorted
on. If you are sorting on numerical or datestamp data and using zero-padding
to influence sort order, I recommend switching over.
my $int32_type = KinoSearch::FieldType::Int32Type->new(
indexed => 0,
sortable => 1,
);
$schema->spec_field( name => 'votes', type => $int32_type );
Note that if you're doing datestamp sorting, you should use either Float64Type
or Int64Type, at least until I add a UInt32Type. :)
my $float64_type = KinoSearch::FieldType::Float64Type->new(
indexed => 0,
sortable => 1,
);
$schema->spec_field( name => 'time_hires', type => $float64_type );
Marvin Humphrey
More information about the kinosearch
mailing list