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

Robert Muir commented on LUCENE-9568:
-------------------------------------

I'm not sure its so simple: today with TopTermsRewrite we may give it 
negatives, and everything is happily sorted and top-n'd correctly, and it will 
just truncate them at the very end (when it goes to create the actual Query 
object). So it still gives a correct top-N. See Adrien's link.

If we were to do it any "sooner" (e.g. in fuzzytermsenum itself), it may 
compute an incorrect top-N.

I think the problem is just that only TopTermsRewrite does this (honestly, it 
is really the only one that should be used with this crazy query). The other 
more exotic rewrite methods that might be used by spans or highlighters don't 
do it, so there will be problems today in those cases.

> FuzzyTermEnums sets negative boost for fuzzy search & highlight
> ---------------------------------------------------------------
>
>                 Key: LUCENE-9568
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9568
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/highlighter
>    Affects Versions: 8.5.1
>            Reporter: Juraj Jurčo
>            Priority: Minor
>              Labels: highlighting, newbie
>         Attachments: FindSqlHighlightTest.java
>
>
> *Description*
>  When user indexes a word with an apostrophe and constructs a fuzzy query for 
> highlighter, it throws an exception with set negative boost for a query. 
> *Repro Steps*
>  # Index a text with apostrophe. E.g. doesn't
>  # Parse a fuzzy query e.g.: se~, se~2, se~3
>  # Try to highlight a text with apostrophe
>  # The exception is thrown (for details see attached test test with repro 
> steps)
> *Actual Result*
>  {{java.lang.IllegalArgumentException: boost must be a positive float, got 
> -1.0}}
> *Expected Result*
>  * No exception.
>  * Highlighting marks are inserted into a text.
> *Workaround*
>  - not known.



--
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