[ https://issues.apache.org/jira/browse/LUCENE-8344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16500343#comment-16500343 ]
David Smiley commented on LUCENE-8344: -------------------------------------- To demonstrate the issue in the patch I added a TokenStreamToAutomaton.BUG boolean flag so a test can see what happens when the suggest index had trailing holes but differs at query time. org.apache.lucene.search.suggest.analyzing.AnalyzingSuggesterTest#testStandard see the "round trip" test With BUG==true: fails (bad for back-compat) With BUG==false: passes (therefore a reindex fixes) org.apache.lucene.search.suggest.document.TestPrefixCompletionQuery#testAnalyzerWithSepAndNoPreservePos see "test trailing stopword with a new document" With BUG==true: passes (good for back-compat) With BUG==false: fails(*) (*): however if you flip the analyzer passed to the PrefixCompletionQuery constructor to the "completionAnalyzer" (instead of the plain/original "analyzer"), then it passes. So apparently this may require users change how it's used? (ouch) CC [~areek] > TokenStreamToAutomaton doesn't ignore trailing posInc when > preservePositionIncrements=false > ------------------------------------------------------------------------------------------- > > Key: LUCENE-8344 > URL: https://issues.apache.org/jira/browse/LUCENE-8344 > Project: Lucene - Core > Issue Type: Bug > Components: modules/suggest > Reporter: David Smiley > Priority: Major > Attachments: LUCENE-8344.patch, LUCENE-8344.patch > > > TokenStreamToAutomaton in Lucene core is used by the AnalyzingSuggester > (incl. FuzzySuggester subclass ) and NRT Document Suggester and soon the > SolrTextTagger. It has a setting {{preservePositionIncrements}} defaulting > to true. If it's set to false (e.g. to ignore stopwords) and if there is a > _trailing_ position increment greater than 1, TS2A will _still_ add position > increments (holes) into the automata even though it was configured not to. > I'm filing this issue separate from LUCENE-8332 where I first found it. The > fix is very simple but I'm concerned about back-compat ramifications so I'm > filing it separately. I'll attach a patch to show the problem. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org