[ 
https://issues.apache.org/jira/browse/LUCENE-6061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14216536#comment-14216536
 ] 

Michael McCandless commented on LUCENE-6061:
--------------------------------------------

I think you could do this with PH using an appropriate tokenizer.

Ie, you'd have a custom tokenizer that tokenizes your markup into the 4 
different cases (so you are still indexing 4 different fields), but that 
tokenizer carefully sets the token offsets into the original text (which you'd 
store with no markup).

At search time, regardless of which of the 4 fields was used for searching, 
you'd then use the token offsets against the same original stored field.  You 
should be able to do this by overriding PostingsHighlighter.loadFieldValues... 
though maybe we could make this easier somehow, to say "when I highlight field 
X, load its content from field Y"...

> Add Support for something different than Strings in Highlighting 
> (FastVectorHighlighter)
> ----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-6061
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6061
>             Project: Lucene - Core
>          Issue Type: Wish
>          Components: core/search, modules/highlighter
>    Affects Versions: Trunk
>            Reporter: Martin Braun
>            Priority: Critical
>              Labels: FastVectorHighlighter, Highlighter, Highlighting
>             Fix For: 4.10.2, 5.0, Trunk
>
>
> In my application I need Highlighting and I stumbled upon the really neat 
> FastVectorHighlighter. One problem appeared though. It lacks a way to render 
> the Highlights into something different than Strings, so I rearranged some of 
> the code to support that:
> https://github.com/Hotware/LuceneBeanExtension/blob/master/src/main/java/de/hotware/lucene/extension/highlight/FVHighlighterUtil.java
> Is there a specific reason to only support String[] as a return type? If not, 
> I would be happy to write a new class that supports rendering into a generic 
> Type and rewire that into the existing class (or just do it as an addition 
> and leave the current class be).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to