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

Alan Woodward commented on LUCENE-9439:
---------------------------------------

This looks fantastic [~dweiss]!  We should probably change the issue 
description to better describe what you've added (ie a whole new highlighter 
impl) - or do you want to split the changes to Matches and the new highlighter 
into two separate issues?

One thing that might be nice would be to add something like the test 
highlighter into the main code line, as currently you have to do a fair amount 
of work to actually use this.  But we can do that as a followup - I wouldn't be 
surprised if we can build factory methods that more or less replace the 
existing highlighters.  I also need to think about how we can integrate 
submatches into this - it would be great to add the submatches of a span or 
interval hit as well as the overall match, and use the latter to build passages 
but the former to do actual highlighting.

> Matches API should enumerate hit fields that have no positions (no iterator)
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-9439
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9439
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>         Attachments: LUCENE-9439.patch, matchhighlighter.patch
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> I have been fiddling with Matches API and it's great. There is one corner 
> case that doesn't work for me though -- queries that affect fields without 
> positions return {{MatchesUtil.MATCH_WITH_NO_TERMS}} but this constant is 
> problematic as it doesn't carry the field name that caused it (returns null).
> The associated fromSubMatches combines all these constants into one (or 
> swallows them) which is another problem.
> I think it would be more consistent if MATCH_WITH_NO_TERMS was replaced with 
> a true match (carrying field name) returning an empty iterator (or a constant 
> "empty" iterator NO_TERMS).
> I have a very compelling use case: I wrote an "auto-highlighter" that runs on 
> top of Matches API and automatically picks up query-relevant fields and 
> snippets. Everything works beautifully except for cases where fields are 
> searchable but don't have any positions (token-like fields).
> I can work on a patch but wanted to reach out first - [~romseygeek]?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to