You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2021/06/17 18:31:00 UTC

[jira] [Commented] (LUCENE-10007) CommonGramsQueryFilter: javadoc example does not produce output indicated

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

Chris M. Hostetter commented on LUCENE-10007:
---------------------------------------------

FWIW: I haven't been able to think of anyway that the current behavior "breaks" the intended phrase query usecase of CommonGrams(Query)Filter ... IIUC it just seems to cause the phrase to include a redundant extra term that can make the query a little slower then it might need to be? ... but I don't think it can cause anything unexpected in the set of matching documents.

But it's possible i'm missing something ... and I'm still not clear if it's a bug in the code, or a bug in the docs and the code was always expected to work this way.

> CommonGramsQueryFilter: javadoc example does not produce output indicated
> -------------------------------------------------------------------------
>
>                 Key: LUCENE-10007
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10007
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Chris M. Hostetter
>            Priority: Major
>         Attachments: LUCENE-10007.patch
>
>
> CommonGramsQueryFilter has the following explanation of it's behavior + example twice in it's javadocs (both at the class level and the incrementToken method level)..
> {noformat}
> /**
>  * Wrap a CommonGramsFilter optimizing phrase queries by only returning single words when they are
>  * not a member of a bigram.
>  *
>  * <p>Example:
>  *
>  * <ul>
>  *   <li>query input to CommonGramsFilter: "the rain in spain falls mainly"
>  *   <li>output of CommomGramsFilter/input to CommonGramsQueryFilter: |"the, "the-rain"|"rain"
>  *       "rain-in"|"in, "in-spain"|"spain"|"falls"|"mainly"
>  *   <li>output of CommonGramsQueryFilter:"the-rain", "rain-in" ,"in-spain", "falls", "mainly"
>  * </ul>
>  */
> {noformat}
> But this input doesn't actually produce the documented output: CommonGramsQueryFilter does in fact produce a token for "spain" even though it is part of the "in-spain" bigram.
> I'm not really sure which is "wrong" – the implementation or the documentation – but something seems to be out of whack.
>  ----
> _(a more trivial discrepancy is the use of "_" [underscore] in the CommomGramsFilter vs "-" [dash] in the javadoc example)_



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

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