}
next if (lc($string) eq lc($term));
$hash{$string}++;
+ $hash{$string}++ if (lc($$x[0]) eq lc($term));
}
my $from = [ sort { $hash{$b} <=> $hash{$a} || $a cmp $b } keys %hash ];
}
next if (lc($string) eq lc($term));
$hash{$string}++;
+ $hash{$string}++ if (lc($$x[0]) eq lc($term));
}
my $also = [ sort { $hash{$b} <=> $hash{$a} || $a cmp $b } keys %hash ];
my $fts = OpenILS::Application::Storage::FTS->compile($term, 'f.value', "f.$index_col");
my $fts_where = $fts->sql_where_clause;
- my $fts_words = join '%', map { s/([\%\_'])/\\$1/go; }$fts->words;
+ my $fts_words = join '%', $fts->words;
my $fts_words_where = "f.value LIKE '$fts_words\%'";
FROM $search_table f,
$marc_table a
WHERE $fts_where
- AND $fts_words_where
+ -- AND $fts_words_where
$tag_where
$sf_where
AND a.id = f.record
my $term = shift;
(my $class = $self->api_name) =~ s/^.+authority.([^\.]+)\.see.+$/$1/o;
+ my $sf = 'a';
+ $sf = 't' if ($class eq 'title');
my @marc = $self->method_lookup('open-ils.storage.authority.search.marc')
- ->run( term => $term, tag => '4%', subfield => 'a' );
+ ->run( term => $term, tag => '4%', subfield => $sf );
for my $m ( @marc ) {
my $doc = $parser->parse_string($m);
my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*');
my $term = shift;
(my $class = $self->api_name) =~ s/^.+authority.([^\.]+)\.see.+$/$1/o;
+ my $sf = 'a';
+ $sf = 't' if ($class eq 'title');
my @marc = $self->method_lookup('open-ils.storage.authority.search.marc')
- ->run( term => $term, tag => '5%', subfield => 'a' );
+ ->run( term => $term, tag => '5%', subfield => $sf );
for my $m ( @marc ) {
my $doc = $parser->parse_string($m);
my @nodes = $doc->documentElement->findnodes('//*[substring(@tag,1,1)="1"]/*');