my $results_per_page = $params->{'count'} || $count;
my $offset = $params->{'offset'} || 0;
my $whole_record = $params->{'whole_record'} || 0;
my $weight_search = $params->{'weight_search'} || 0;
my $weight_search = $params->{'advsearch'} ? $params->{'weight_search'} || 0 : 1;
$offset = 0 if $offset < 0;
my $page = $cgi->param('page') || 1;
#my $offset = ($page-1)*$results_per_page;
$offset = ($page-1)*$results_per_page if $page>1;
my $hits;
my $weight_search = $cgi->param('weight_search') || 0;
my $weight_search = $cgi->param('advsearch') ? $cgi->param('weight_search') || 0 : 1;
# Define some global variables
my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type);
-