X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=inline;f=lib%2FBackupPC%2FSearch%2FKinoSearch.pm;fp=lib%2FBackupPC%2FSearch%2FKinoSearch.pm;h=a745415c4ea3af2d629950055abed2821e204a13;hb=18add9ff73c8924a7c5acdcf57be9b4024da53c1;hp=e3431b5cc2c3ef3cd3e19983f642b8bb1ef54cea;hpb=0f07aea3d66a05b063df536662051aacedb00029;p=BackupPC.git diff --git a/lib/BackupPC/Search/KinoSearch.pm b/lib/BackupPC/Search/KinoSearch.pm index e3431b5..a745415 100644 --- a/lib/BackupPC/Search/KinoSearch.pm +++ b/lib/BackupPC/Search/KinoSearch.pm @@ -11,6 +11,8 @@ use Data::Dump qw(dump); # my $tokenizer = KinoSearch::Analysis::Tokenizer->new( pattern => '\\w' ); +# numeric_padding values are used in range search, and muse be sortable + sub new { my $class = shift @_; my %Conf = @_; @@ -23,7 +25,6 @@ sub new { numeric_padding => [ qw( backup_date date - size ) ], }, $class; @@ -54,7 +55,6 @@ sub indexer { # numeric $schema->spec_field( name => $_, type => $string_type ) foreach ( qw/ - backup_date fid shareid type @@ -75,6 +75,7 @@ sub indexer { # sortable numeric $schema->spec_field( name => $_, type => $sort_type ) foreach (qw/ backupnum + backup_date date size /); @@ -118,7 +119,7 @@ sub exists { return $hits->total_hits; } -sub _numeric_padding { sprintf "%011d", $_[0] } +sub _numeric_padding { sprintf "%010d", $_[0] } # pad up to 32bit number (timestamp) sub add_doc { my ($self,$row) = @_;