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

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

It is clever - personally I think I'd prefer the getFields method - this is 
kind of a hack to get the field - though a pretty clever hack. I suppose we 
could make the argument that this can tide us over - but it will only take a 
couple of minutes to add getFields as well.

I think Simon may argue that this will work in more cases by default - where 
external queries would have to implement the getFeilds method. Which is a good 
point. Still would prefer something cleaner, but perhaps that makes this worth 
it nonetheless. It would prob make sense to fall back to this if getFields 
returned an empty set anyway - which almost makes it not even worth it to do 
getFields as things don't get any cleaner ...

We def want the multitermquery clone - thats for sure - Uwe recently mentioned 
that as well and I'd been meaning to get around to it myself.

> Highlighter should support all MultiFieldQuery 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