[jira] [Commented] (LUCENE-7848) QueryBuilder.analyzeGraphPhrase does not handle gaps correctly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (LUCENE-7848) QueryBuilder.analyzeGraphPhrase does not handle gaps correctly

JIRA jira@apache.org

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

Dawid Weiss commented on LUCENE-7848:
-------------------------------------

Hi Jim,

The patch looks ok, although it doesn't solve the original problem -- why, I don't know. This is the query in Solr:
{code}
funding_program:"SPECIAL PROJECTS - XXX,SPECIAL PROJECTS - YYY"
{code}

This (in Solr) gets translated into:
{code}
+SpanNearQuery(
  spanNear([
    funding_program:special,
    funding_program:projects,
    funding_program:-,
    spanOr([
        spanNear([SpanGap(:1), funding_program:xxx,special], 0, true),
        spanNear([SpanGap(:1), funding_program:xxx, funding_program:special], 0, true)
    ]),
    funding_program:projects,
    funding_program:-,
    SpanGap(:1),
    funding_program:yyy], 0, true))
{code}

Those odd-looking span gaps are emitted by the WordDelimiterGraphFilter (with the flags above); virtually the same config is used for indexing, but the query doesn't match the indexed content. A code-based test would be much better to pinpoint the problem here. I'll try to provide one.

> QueryBuilder.analyzeGraphPhrase does not handle gaps correctly
> --------------------------------------------------------------
>
>                 Key: LUCENE-7848
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7848
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 6.5, 6.6
>            Reporter: Jim Ferenczi
>         Attachments: LUCENE-7848.patch
>
>
> Position increments greater than 1 are ignored when the query builder creates a graph phrase query.
> Instead it should use SpanNearQuery.addGap for pos incr > 1.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]