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

Mark Miller commented on LUCENE-2064:
-------------------------------------

As I said, thinking about it, I don't think we can end up fixing it in a better 
way. We can't force older impls out there to implement what we need - sure we 
can fix it in core easy enough, but its a real hassle to do this in another way 
that doesnt require outside multitermquery impls to change - we are going to 
have to fall back to this anyway with any current plans. So might as well nix 
those plans for now. I'd prefer our "futurebetterhighlighter" prompt any 
changes that require so much hassle. Its prob best just to stick with this 
method.

I'd just make it so the rest of the IndexReader methods act as if the thing is 
empty - letting it throw a null pointer exception and catching it makes those 
impls unhighlightable when they likely could be.

> Highlighter should support all MultiTermQuery subclasses without casts
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-2064
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2064
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/highlighter
>    Affects Versions: 2.9.1
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 3.0
>
>         Attachments: LUCENE-2064.txt
>
>
> In order to support MultiTermQuery subclasses the Highlighter component 
> applies instanceof checks for concrete classes from the lucene core. This 
> prevents classes like RegexQuery in contrib from being supported. Introducing 
> dependencies on other contribs is not feasible just for being supported by 
> the highlighter.
> While the instanceof checks and subsequent casts might hopefully go somehow 
> away  in the future but for supporting more multterm queries I have a 
> alternative approach using a fake IndexReader that uses a RewriteMethod to 
> force the MTQ to pass the field name to the given reader without doing any 
> real work. It is easier to explain once you see the patch - I will upload 
> shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to