Module: SearchDo::Backends::HyperEstraier::EstraierPureExtention::ResultDocument

Defined in:
lib/search_do/backends/hyper_estraier/estraier_pure_extention.rb

Instance Method Summary collapse

Instance Method Details

#snippet_aObject

wacky snippet string parsed into a nice array of lines where the found word (here: a search for bob) is marked to be highlighted

[“hallo my name is ”,false],,[“ butcher”,false]

output does not contain HTML



50
51
52
53
54
55
# File 'lib/search_do/backends/hyper_estraier/estraier_pure_extention.rb', line 50

def snippet_a
  snip = @snippet.sub(/^\.+/,"\n")#first ... can be understood as \n
  snip.split("\n").reject{|x|x==''}.map do |part|
    part.include?("\t") ? [part.split("\t")[0],true] : [part,false]
  end
end