i have now the solution for my problem. The "hit" - Objekt in the "each_hit_with_result" function return a list with the matched substrings, called "highlight"
search2 = WebsiteEntry.search do
fulltext params[:q] do
highlight :domain
end
end
search2.each_hit_with_result do |hit, res|
hit.highlight(:domain).format { |word| puts "highlight: "+word}
No I´m getting each matched string form the full text search. The Problem was, that i didn`t mark my attribute as highlight. Thx