[
https://issues.apache.org/jira/browse/LUCENE-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642993#action_12642993
]
Mark Harwood commented on LUCENE-1425:
--------------------------------------
Delegating responsibility away from WeightedSpanTermExtractor seems desirable
to avoid having special-case "if clause instanceof xxx"- type logic everywhere.
I suppose "extractTerms" was the core Query API's previous nod to supporting
highlighting but is obviously falling short of what we need because:
1) It relies on generating potentially large lists of terms
2) It has no corresponding API that can be called on nested Filters
3) It does not reproduce positional logic e.g. Phrase/span queries
The above TokenMatcher API certainly seems like a clean API from the
highlighter's perspective but implementing it in queries/filters could prove
trickier - especially for "container" classes such as BooleanQuery, SpanQuery,
FilteredQuery, ConstantScoreQueries wrapping CachingWrapperFilters etc.
There's a lot to consider here and Mark M's suggestion of adding more
"special-case" logic into WeightedSpanTermExtractor may be a sensible holding
position for now (guaranteed, as soon as Lucene-1424 is committed people will
start squealing for some related highlighting support!) Another temporary
alternative to consider is for Lucene-1424's "ConstantScoreXxxxQuerys" to
implement extractTerms() in which case they retain the list of terms they
generate - solely for highlighting purposes. This would require no specialised
logic to be added to WeightedSpanTermExtractor and makes use of the
existing-but-suboptimal "highlighter-support" API (Query.extractTerms)
> Add ConstantScore highlighting support to SpanScorer
> ----------------------------------------------------
>
> Key: LUCENE-1425
> URL: https://issues.apache.org/jira/browse/LUCENE-1425
> Project: Lucene - Java
> Issue Type: New Feature
> Components: contrib/highlighter
> Reporter: Mark Miller
> Assignee: Mark Miller
> Priority: Minor
> Attachments: LUCENE-1425.patch
>
>
> Its actually easy enough to support the family of constantscore queries with
> the new SpanScorer. This will also remove the requirement that you rewrite
> queries against the main index before highlighting (in fact, if you do, the
> constantscore queries will not highlight).
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]