Displaying 1 result from an estimated 1 matches for "highlight_for_query".
2005 Dec 14
4
Is it possible to highlight search keywords in results?
...;'m not making sense,
here is an example of what I want:
query = ''contents:"testing|trucks"''
prepend = ''<strong>''
append = ''</strong>''
count = index.search_each(query) do |doc, score|
highlighted_contents =
index.highlight_for_query(doc, query, prepend, append)
puts highlighted_contents
end
This would make all instances of "testing" and "trucks" appear in bold
for html formatted text. Thoughts?
Thanks,
Carl