projects
/
BackupPC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0f07aea
)
numeric_padding values are used in range search, and muse be sortable
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 11 Jan 2011 18:32:11 +0000
(18:32 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 11 Jan 2011 18:32:11 +0000
(18:32 +0000)
lib/BackupPC/Search/KinoSearch.pm
patch
|
blob
|
history
diff --git
a/lib/BackupPC/Search/KinoSearch.pm
b/lib/BackupPC/Search/KinoSearch.pm
index
e3431b5
..
a745415
100644
(file)
--- 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' );
# 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 = @_;
sub new {
my $class = shift @_;
my %Conf = @_;
@@
-23,7
+25,6
@@
sub new {
numeric_padding => [ qw(
backup_date
date
numeric_padding => [ qw(
backup_date
date
- size
) ],
}, $class;
) ],
}, $class;
@@
-54,7
+55,6
@@
sub indexer {
# numeric
$schema->spec_field( name => $_, type => $string_type ) foreach ( qw/
# numeric
$schema->spec_field( name => $_, type => $string_type ) foreach ( qw/
- backup_date
fid
shareid
type
fid
shareid
type
@@
-75,6
+75,7
@@
sub indexer {
# sortable numeric
$schema->spec_field( name => $_, type => $sort_type ) foreach (qw/
backupnum
# sortable numeric
$schema->spec_field( name => $_, type => $sort_type ) foreach (qw/
backupnum
+ backup_date
date
size
/);
date
size
/);
@@
-118,7
+119,7
@@
sub exists {
return $hits->total_hits;
}
return $hits->total_hits;
}
-sub _numeric_padding { sprintf "%01
1d", $_[0] }
+sub _numeric_padding { sprintf "%01
0d", $_[0] } # pad up to 32bit number (timestamp)
sub add_doc {
my ($self,$row) = @_;
sub add_doc {
my ($self,$row) = @_;