Index: /branches/release-30/lib/MT/Core.pm
===================================================================
--- /branches/release-30/lib/MT/Core.pm (revision 1422)
+++ /branches/release-30/lib/MT/Core.pm (revision 1431)
@@ -526,4 +526,14 @@
                 methods => sub { MT->app->core_methods() },
                 params  => sub { MT->app->core_query_params() },
+                #author => {
+                #    columns => [ qw( name nickname email url ) ],
+                #    'sort' => 'created_on',
+                #    terms   => { status => 1 }, #MT::Author::ACTIVE()
+                #},
+                entry => {
+                    columns => [ qw( title keywords text text_more ) ],
+                    'sort' => 'authored_on',
+                    terms   => { status => 2 }, #MT::Entry::RELEASE()
+                },
             },
             'cms'      => {
Index: /branches/release-30/lib/MT/App/Search.pm
===================================================================
--- /branches/release-30/lib/MT/App/Search.pm (revision 1421)
+++ /branches/release-30/lib/MT/App/Search.pm (revision 1431)
@@ -11,5 +11,4 @@
 
 use MT::Util qw( encode_html );
-use MT::Entry qw( :constants );
 
 sub id { 'new_search' }
@@ -27,5 +26,4 @@
     return {
         'search' => \&process,
-        'author' => \&process,
     };
 }
@@ -66,4 +64,6 @@
             $app->config->$key() : ($q->param($key) || $app->config->$key());
     }
+
+    $app->{searchparam}{Type} = $q->param('type') || 'entry';
 }
 
@@ -121,11 +121,11 @@
     my $app = shift;
 
-    my ( $terms, $args ) = $app->search_terms();
+    my @arguments = $app->search_terms();
     return $app->error($app->errstr) if $app->errstr;
 
     my $count = 0;
     my $iter;
-    if ( $terms && @$terms ) {
-        ( $count, $iter ) = $app->execute( $terms, $args );
+    if ( @arguments ) {
+        ( $count, $iter ) = $app->execute( @arguments );
         return $app->error($app->errstr) unless $iter;
 
@@ -147,5 +147,6 @@
     my ( $terms, $args ) = @_;
 
-    my $class = $app->model( $app->mode eq 'search' ? 'entry' : $app->mode );
+    my $class = $app->model( $app->{searchparam}{Type} )
+        or return $app->errtrans('Unsupported type: [_1]', $app->{searchparam}{Type});
     my $count = $app->count( $class, $terms, $args );
     #TODO: cache!
@@ -167,29 +168,26 @@
     $limit = $max if !$limit || ( $limit - $offset > $max );
 
-    my $type = $q->param('type');
-    my $entry_type = $app->mode eq 'search'
-      ? 1
-      : $type
-        ? ( 'entry' eq lc($type) || 'page' eq lc($type)
-          ? 1
-          : 0 )
-        : 0;
-
-    my $def_terms = {
-        $entry_type ? ( status => MT::Entry::RELEASE() ) : (),
-        $type ? ( class  => $type ) : (),
-        exists( $app->{searchparam}{IncludeBlogs} )
-          ? ( blog_id => [ keys %{ $app->{searchparam}{IncludeBlogs} } ] )
-          : (),
-    };
+    my $params = $app->registry( $app->{searchparam}{Type} );
+    my %def_terms = exists( $params->{terms} )
+          ? %{ $params->{terms} }
+          : ();
+    delete $def_terms{'plugin'}; #FIXME: why is this in here?
+
+    if ( exists $app->{searchparam}{IncludeBlogs} ) {
+        $def_terms{blog_id} = [ keys %{ $app->{searchparam}{IncludeBlogs} } ];
+    }
+
     my @terms;
-    push @terms, $def_terms if %$def_terms;
-
-    my $columns = $app->mode eq 'search'
-      ? [ [ qw( title keywords text text_more ) ] ]
-      : $app->registry( $app->mode, 'columns' );
-    $columns = $columns->[0]; # FIXME: Why?
-    return $app->errtrans('No columns to search for was specified for [_1]', $app->mode)
+    push @terms, \%def_terms if %def_terms;
+
+    my $columns = $params->{columns};
+    my $sort = $params->{'sort'};
+    if ( $sort !~ /\w+\!$/  && exists($app->{searchparam}{Sort}) ) {
+        $sort = $app->{searchparam}{Sort};
+    }
+
+    return $app->errtrans('No column was specified to search for [_1].', $app->{searchparam}{Type})
         unless $columns && @$columns;
+
     my $number = scalar @$columns;
     my @and;
@@ -208,5 +206,5 @@
       'sort' => [
         { desc   => 'descend' eq $app->{searchparam}{ResultDisplay} ? 'DESC' : 'ASC',
-          column => $entry_type ? 'authored_on' : 'created_on' }
+          column => $sort }
       ]
     );
@@ -296,6 +294,5 @@
     $ctx->stash('results', $iter);
     $ctx->stash('count',   $count);
-    $ctx->stash('stash_key', $app->mode)
-        if 'search' ne $app->mode;
+    $ctx->stash('stash_key', $app->{searchparam}{Type} );
     $ctx->stash('include_blogs',
         join ',', keys %{ $app->{searchparam}{IncludeBlogs} });
@@ -313,5 +310,5 @@
     my $app = shift;
     my ( $tmpl ) = @_;
-    $tmpl
+    $tmpl;
 }
 
@@ -322,5 +319,4 @@
     my $tmpl = $app->load_search_tmpl( $count, $iter );
     $tmpl = $app->pre_render( $tmpl );
-
     $tmpl;
 }
