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

Christoph Goller commented on LUCENE-2861:
------------------------------------------

The problem is caused by overlapping matches within spanNear2. The first match 
for spanNear2 matches "intended message" and the second "message" to the same 
"message" in the text so that the match for "addressed" ist to far away. One 
possible fix would forbid overlapping matches or add aspecial very compley 
treatment like in SloppyPhraseScore. I think it would be better to give up lazy 
backtracking and implement a correct backtracking (see LUCENE-7398).

> Search doesn't return document via query
> ----------------------------------------
>
>                 Key: LUCENE-2861
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2861
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/search
>    Affects Versions: 2.9.1, 2.9.4, 3.0.3
>         Environment: Doesn't depend on enviroment
>            Reporter: Zenoviy Veres
>
> The query doesn't return document that contain all words from query in 
> correct order.
> The issue might be within mechanism how do SpanQuerys actually match results 
> (http://www.lucidimagination.com/blog/2009/07/18/the-spanquery/)
> Please refer for details below. The example text wasn't passed through 
> snowball analyzer, however the issue exists after analyzing too
> Query:
> (intend within 3 of message) within 5 of message within 3 of addressed.  
> Text within document:
> The contents of this e-mail message and
> any attachments are intended solely for the
> addressee(s) and may contain confidential
> and/or legally privileged information. If you
> are not the intended recipient of this message
> or if this message has been addressed to you
> in error, please immediately alert the sender
>  by reply e-mail and then delete this message
> and any attachments
> Result query:
>         SpanNearQuery spanNear = new SpanNearQuery(new SpanQuery[] {
>                 new SpanTermQuery(new Term(BODY, "intended")),
>                 new SpanTermQuery(new Term(BODY, "message"))},
>                 4,
>                 false);
>         SpanNearQuery spanNear2 = new SpanNearQuery(new SpanQuery[] 
> {spanNear, new SpanTermQuery(new Term(BODY, "message"))}, 5, false);
>         SpanNearQuery spanNear3 = new SpanNearQuery(new SpanQuery[] 
> {spanNear2, new SpanTermQuery(new Term(BODY, "addressed"))}, 3, false);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to