{
foreach my $word (split(/ /, @$value[$i])) # if operator is contains, splits the words in separate requests
{
- push @not_tags, @$tags[$i];
- push @not_subfields, @$subfields[$i];
- push @not_and_or, "or"; # as request is negated, finds "foo" or "bar" if final request is NOT "foo" and "bar"
- push @not_operator, @$operator[$i];
- push @not_value, $word;
+ unless (C4::Context->stopwords->{uc($word)}) { #it's NOT a stopword => use it. Otherwise, ignore
+ push @not_tags, @$tags[$i];
+ push @not_subfields, @$subfields[$i];
+ push @not_and_or, "or"; # as request is negated, finds "foo" or "bar" if final request is NOT "foo" and "bar"
+ push @not_operator, @$operator[$i];
+ push @not_value, $word;
+ }
}
}
else
{
foreach my $word (split(/ /, @$value[$i]))
{
- push @normal_tags, @$tags[$i];
- push @normal_subfields, @$subfields[$i];
- push @normal_and_or, "and"; # assumes "foo" and "bar" if "foo bar" is entered
- push @normal_operator, @$operator[$i];
- push @normal_value, $word;
+ unless (C4::Context->stopwords->{uc($word)}) { #it's NOT a stopword => use it. Otherwise, ignore
+ push @normal_tags, @$tags[$i];
+ push @normal_subfields, @$subfields[$i];
+ push @normal_and_or, "and"; # assumes "foo" and "bar" if "foo bar" is entered
+ push @normal_operator, @$operator[$i];
+ push @normal_value, $word;
+ }
}
}
else
</td>
<td>
<select name="operator" size="1" onchange="sql_update()">
+ <option <TMPL_IF NAME="contains">selected</TMPL_IF> value="contains">Contains</option>
<option <TMPL_IF NAME="eq">selected</TMPL_IF> value="=">Is equal to</option>
<option <TMPL_IF NAME="start">selected</TMPL_IF> value="start">Starts with</option>
- <option <TMPL_IF NAME="contains">selected</TMPL_IF> value="contains">Contains</option>
<option <TMPL_IF NAME="gt">selected</TMPL_IF> value=">">Is greater than</option>
<option <TMPL_IF NAME="ge">selected</TMPL_IF> value=">=">Is greater or equal to</option>
<option <TMPL_IF NAME="lt">selected</TMPL_IF> value="<">Is lower than</option>
</td>
<td>
<select name="operator" size="1" onchange="sql_update()">
+ <option <TMPL_IF NAME="contains">selected</TMPL_IF> value="contains">Contient</option>
<option <TMPL_IF NAME="eq">selected</TMPL_IF> value="=">Egale</option>
<option <TMPL_IF NAME="start">selected</TMPL_IF> value="start">Commence par</option>
- <option <TMPL_IF NAME="contains">selected</TMPL_IF> value="contains">Contient</option>
<option <TMPL_IF NAME="gt">selected</TMPL_IF> value=">">Supérieur à</option>
<option <TMPL_IF NAME="ge">selected</TMPL_IF> value=">=">Supérieur ou égal à</option>
<option <TMPL_IF NAME="lt">selected</TMPL_IF> value="<">Inférieur à</option>