From d4703f4b5c91704d16c9cd97381777a5c4df75cc Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 9 Jan 2011 19:02:51 +0000 Subject: [PATCH 1/1] more specific schema desing for sorting --- lib/BackupPC/Search/KinoSearch.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/BackupPC/Search/KinoSearch.pm b/lib/BackupPC/Search/KinoSearch.pm index 1d1b256..0301fa3 100644 --- a/lib/BackupPC/Search/KinoSearch.pm +++ b/lib/BackupPC/Search/KinoSearch.pm @@ -43,22 +43,34 @@ sub indexer { ); my $blob_type = KinoSearch::Plan::BlobType->new( stored => 1 ); my $string_type = KinoSearch::Plan::StringType->new; # non-tokenized - my $num_type = KinoSearch::Plan::Int64Type->new; + my $num_type = KinoSearch::Plan::Int64Type->new( sortable => 1 ); + my $sort_type = KinoSearch::Plan::StringType->new( sortable => 1 ); # non-tokenized # numeric $schema->spec_field( name => $_, type => $string_type ) foreach ( qw/ backup_date backupnum - date fid shareid - size type / ); # non-tokenized strings $schema->spec_field( name => $_, type => $string_type ) foreach ( qw/ - _uri filepath hname sname + _uri + hname + /); + + # sortable + $schema->spec_field( name => $_, type => $sort_type ) foreach (qw/ + sname + filepath + /); + + # sortable numeric + $schema->spec_field( name => $_, type => $sort_type ) foreach (qw/ + date + size /); # tokenized magic columns for infix search -- 2.20.1