46 |
} |
} |
47 |
|
|
48 |
print STDERR "swish search: $s\n"; |
print STDERR "swish search: $s\n"; |
49 |
|
|
50 |
|
# convert to UTF-8 |
51 |
|
$s = $iso2utf->convert($s) || $s; |
52 |
my $results = $index->Query($s); |
my $results = $index->Query($s); |
53 |
|
|
54 |
# store total number of hits |
# store total number of hits |
56 |
|
|
57 |
my @res_ids; |
my @res_ids; |
58 |
|
|
59 |
my $count = 0; |
my $count = 1; |
60 |
|
|
61 |
while ( my $r = $results->NextResult ) { |
while ( my $r = $results->NextResult ) { |
62 |
|
|
81 |
# this is redundant, but needed for templates later... |
# this is redundant, but needed for templates later... |
82 |
$self->{cache}->{$id}->{'id'} = $id; |
$self->{cache}->{$id}->{'id'} = $id; |
83 |
|
|
84 |
last if ($count++ > $self->{max_results}); |
last if (++$count > $self->{max_results}); |
85 |
} |
} |
86 |
|
|
87 |
return @res_ids; |
return @res_ids; |