elastics-rails - Result Extenders

The elastics-rails gem adds an extender to the standard extended Elastics::Result object (see Result Extenders).

For example, if you asked to highlight the ‘ruby’ term:

# if there are highlights you gets the joined highlight fragments
>> document.highlighted_content
#=> "the <em>Ruby</em> way ... any <em>ruby</em> method"

# if there are no highlights but the attribute exists ('title' in the following example) you get the attribute
>> document.highlighted_title
#=> "Programming Languages"

# if there are no highlights nor attributes named with that name you get an empty string
>> document.highlighted_some_missing_attribute
#=> ""