# Highlighting from multiple indexes

**URL:** <https://www.ruby-forum.com/t/highlighting-from-multiple-indexes/109883>\
**Category:** Ferret\
**Created:** [July 19, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/highlighting-from-multiple-indexes/109883 "2007-07-19T22:31:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [July 19, 2007, 10:31pm UTC](https://www.ruby-forum.com/t/highlighting-from-multiple-indexes/109883/1 "2007-07-19T22:31:54Z")

</div>

Hi.

I’m searching multiple indexes by passing an array of paths to  
Index::IndexReader.new(). I get several hits back, and can determine  
the document id of each.

Now I want to fetch highlighted excerpts from a field in one of the  
matched documents. The problem I’m having is that Index::IndexReader  
doesn’t have a highlight() method. And, while Index::Index does have  
a highlight() method, its new() method doesn’t allow for an array of  
paths.

What am I missing, here?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [July 20, 2007, 10:31am UTC](https://www.ruby-forum.com/t/highlighting-from-multiple-indexes/109883/2 "2007-07-20T10:31:15Z")

</div>

On Thu, Jul 19, 2007 at 03:30:17PM -0400, Jeff M. wrote:

> What am I missing, here?

The Searcher class 🙂  
Create a searcher from your IndexReader and use it’s highlight method.

Cheers,  
Jens

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49 351 46766-0 | Telefax +49 351 46766-66  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold, Hagen Malessa
