when "*", "!*"
e = (operator == "*" ? "EXISTS" : "NOT EXISTS")
"#{e} (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id)"
- when "~", "!~", "|~"
- c = sql_contains("a.filename", value.first, :all_words => (operator != "|~"))
+ when "~", "!~", "*~"
+ c = sql_contains("a.filename", value.first, :all_words => (operator != "*~"))
e = (operator == "!~" ? "NOT EXISTS" : "EXISTS")
"#{e} (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id AND (#{c}))"
when "^", "$"
case operator
when '*', '!*'
(operator == '*' ? cond_description : "NOT (#{cond_description})")
- when '~', '!~', '|~'
+ when '~', '!~', '*~'
(operator == '~' ? '' : "#{cond_description} AND ") +
- sql_contains('a.description', value.first, :match => (operator != '!~'), :all_words => (operator != '|~'))
+ sql_contains('a.description', value.first, :match => (operator != '!~'), :all_words => (operator != '*~'))
when '^', '$'
sql_contains('a.description', value.first, (operator == '^' ? :starts_with : :ends_with) => true)
else
is_all_words =
case operator
when '~' then true
- when '|~', '!~' then false
+ when '*~', '!~' then false
end
fetcher = Redmine::Search::Fetcher.new(
"t-" => :label_ago,
"~" => :label_contains,
"!~" => :label_not_contains,
- "|~" => :label_contains_any_of,
+ "*~" => :label_contains_any_of,
"^" => :label_starts_with,
"$" => :label_ends_with,
"=p" => :label_any_issues_in_project,
:list_subprojects => [ "*", "!*", "=", "!" ],
:date => [ "=", ">=", "<=", "><", "<t+", ">t+", "><t+", "t+", "nd", "t", "ld", "nw", "w", "lw", "l2w", "nm", "m", "lm", "y", ">t-", "<t-", "><t-", "t-", "!*", "*" ],
:date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "><t-", "t-", "t", "ld", "w", "lw", "l2w", "m", "lm", "y", "!*", "*" ],
- :string => [ "~", "|~", "=", "!~", "!", "^", "$", "!*", "*" ],
- :text => [ "~", "|~", "!~", "^", "$", "!*", "*" ],
- :search => [ "~", "|~", "!~" ],
+ :string => [ "~", "*~", "=", "!~", "!", "^", "$", "!*", "*" ],
+ :text => [ "~", "*~", "!~", "^", "$", "!*", "*" ],
+ :search => [ "~", "*~", "!~" ],
:integer => [ "=", ">=", "<=", "><", "!*", "*" ],
:float => [ "=", ">=", "<=", "><", "!*", "*" ],
:relation => ["=", "!", "=p", "=!p", "!p", "*o", "!o", "!*", "*"],
sql = sql_contains("#{db_table}.#{db_field}", value.first)
when "!~"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :match => false)
- when "|~"
+ when "*~"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :all_words => false)
when "^"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :starts_with => true)