* fixing "start by" operator
* in biblio search, - and other signs where not properly managed. Leroy-Beaulieu could not be found
This commit is contained in:
parent
b49f397528
commit
013ae858cd
1 changed files with 3 additions and 2 deletions
|
@ -201,6 +201,7 @@ sub catalogsearch {
|
||||||
@$value[$i] =~ s/\*/%/g;
|
@$value[$i] =~ s/\*/%/g;
|
||||||
# remove % at the beginning
|
# remove % at the beginning
|
||||||
@$value[$i] =~ s/^%//g;
|
@$value[$i] =~ s/^%//g;
|
||||||
|
@$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g;
|
||||||
if(@$excluding[$i]) # NOT statements
|
if(@$excluding[$i]) # NOT statements
|
||||||
{
|
{
|
||||||
$any_not = 1;
|
$any_not = 1;
|
||||||
|
@ -405,7 +406,7 @@ sub create_request {
|
||||||
if ($nb_active==1) {
|
if ($nb_active==1) {
|
||||||
if (@$operator[$i] eq "start") {
|
if (@$operator[$i] eq "start") {
|
||||||
$sql_tables .= "marc_subfield_table as m$nb_table,";
|
$sql_tables .= "marc_subfield_table as m$nb_table,";
|
||||||
$sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]");
|
$sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]%");
|
||||||
if (@$tags[$i]) {
|
if (@$tags[$i]) {
|
||||||
$sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])";
|
$sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])";
|
||||||
}
|
}
|
||||||
|
@ -429,7 +430,7 @@ sub create_request {
|
||||||
if (@$operator[$i] eq "start") {
|
if (@$operator[$i] eq "start") {
|
||||||
$nb_table++;
|
$nb_table++;
|
||||||
$sql_tables .= "marc_subfield_table as m$nb_table,";
|
$sql_tables .= "marc_subfield_table as m$nb_table,";
|
||||||
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]");
|
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]%");
|
||||||
if (@$tags[$i]) {
|
if (@$tags[$i]) {
|
||||||
$sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])";
|
$sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue