I’d like to highlight matching content of a document for a given query.
:field => :content, :excerpt_length => :all,
:pre_tag => “<<”, :post_tag => “>>”
for this. Problem is, I defined my index with a :key => some_hash, and
I’d like to give index.highlight query and some_hash as parameters,
since I have no idea what doc_id is for a given LazyDoc.
Is there a way to retrieve doc_id from a LazyDoc?
Would that be possible to provide index#highlight with a custom key
instead of doc_id?
As a work-around I retrieve doc_id like this:
which I suppose isn’t really optimal.
Any suggestion would be greatly appreciated!
Thanks in advance,