def highlight(query, doc_id, options = {})
      @dir.synchronize do
        ensure_searcher_open()
        @searcher.highlight(do_process_query(query),
                            doc_id,
                            options[:field]||@options[:default_field],
                            options)
      end
    end
def highlight(query, doc_id, options = {})
      @dir.synchronize do
        ensure_searcher_open()
        @searcher.highlight(do_process_query(query),
                            doc_id,
                            options[:field]||@options[:default_field],
                            options)
      end
    end
If you create an Index without any options, it'll simply create an index
 in memory. But this class is highly configurable and every option that
 you can supply to IndexWriter and QueryParser, you can also set here.
 Please look at the options for the constructors to these classes.

 === Options

 See;

 * QueryParser
 * IndexWriter

 default_input_field::   Default: "id". This specifies the default field
                         that will be used when you add a simple string
                         to the index using #add_document or <<.
 id_field::              Default: "id". This field is as the field to
                         search when doing searches on a term. For
                         example, if you do a lookup by term "cat", ie
                         index["cat"], this will be the field that is
                         searched.
 key::                   Default: nil. Expert: This should only be used
                         if you really know what you are doing. Basically
                         you can set a field or an array of fields to be
                         the key for the index. So if you add a document
                         with a same key as an existing document, the
                         existing document will be replaced by the new
                         object.  Using a multiple field key will slow
                         down indexing so it should not be done if
                         performance is a concern. A single field key (or
                         id) should be find however. Also, you must make
                         sure that your key/keys are either untokenized
                         or that they are not broken up by the analyzer.
 auto_flush::            Default: false. Set this option to true if you
                         want the index automatically flushed every time
                         you do a write (includes delete) to the index.
                         This is useful if you have multiple processes
                         accessing the index and you don't want lock
                         errors. Setting :auto_flush to true has a huge
                         performance impact so don't use it if you are
                         concerned about performance. In that case you
                         should think about setting up a DRb indexing
                         service.
 lock_retry_time::       Default: 2 seconds. This parameter specifies how
                         long to wait before retrying to obtain the
                         commit lock when detecting if the IndexReader is
                         at the latest version.
 close_dir::             Default: false.  If you explicitly pass a
                         Directory object to this class and you want
                         Index to close it when it is closed itself then
                         set this to true.
 use_typed_range_query:: Default: true. Use TypedRangeQuery instead of
                         the standard RangeQuery when parsing
                         range queries. This is useful if you have number
                         fields which you want to perform range queries
                         on. You won't need to pad or normalize the data
                         in the field in anyway to get correct results.
                         However, performance will be a lot slower for
                         large indexes, hence the default.

 == Examples

   index = Index::Index.new(:analyzer => WhiteSpaceAnalyzer.new())

   index = Index::Index.new(:path => '/path/to/index',
                            :create_if_missing => false,
                            :auto_flush => true)

   index = Index::Index.new(:dir => directory,
                            :default_slop => 2,
                            :handle_parse_errors => false)

 You can also pass a block if you like. The index will be yielded and
 closed at the index of the box. For example;

   Ferret::I.new() do |index|
     # do stuff with index. Most of your actions will be cached.
   end
 Returns an array of strings with the matches highlighted. The +query+ can
 either a query String or a Ferret::Search::Query object. The doc_id is
 the id of the document you want to highlight (usually returned by the
 search methods). There are also a number of options you can pass;

 === Options

 field::            Default: @options[:default_field]. The default_field
                    is the field that is usually highlighted but you can
                    specify which field you want to highlight here. If
                    you want to highlight multiple fields then you will
                    need to call this method multiple times.
 excerpt_length::   Default: 150. Length of excerpt to show. Highlighted
                    terms will be in the centre of the excerpt. Set to
                    :all to highlight the entire field.
 num_excerpts::     Default: 2. Number of excerpts to return.
 pre_tag::          Default: "<b>". Tag to place to the left of the
                    match.  You'll probably want to change this to a
                    "<span>" tag with a class. Try "\033[36m" for use in
                    a terminal.
 post_tag::         Default: "</b>". This tag should close the
                    +:pre_tag+. Try tag "\033[m" in the terminal.
 ellipsis::         Default: "...". This is the string that is appended
                    at the beginning and end of excerpts (unless the
                    excerpt hits the start or end of the field.
                    Alternatively you may want to use the HTML entity
                    &#8230; or the UTF-8 string "\342\200\246".