Class: GroongaDelta::Mapping::ExpressionEvaluator::Context

Inherits:
BasicObject
Defined in:
lib/groonga-delta/mapping.rb

Instance Method Summary collapse

Instance Method Details

#groonga_escape_query(text) ⇒ Object



286
287
288
289
290
291
292
293
294
295
# File 'lib/groonga-delta/mapping.rb', line 286

def groonga_escape_query(text)
  case text
  when /[+\-><~*()"\\: ]/
    "\"#{text.gsub("\"", "\\\"")}\""
  when "OR"
    "\"OR\""
  else
    text
  end
end

#html_untag(text) ⇒ Object



282
283
284
# File 'lib/groonga-delta/mapping.rb', line 282

def html_untag(text)
  text.gsub(/<.*?>/, "")
end