You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Trejkaz (JIRA)" <ji...@apache.org> on 2008/03/09 23:41:46 UTC

[jira] Created: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

MultiFieldQueryParser ignores slop parameter
--------------------------------------------

                 Key: LUCENE-1213
                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
             Project: Lucene - Java
          Issue Type: Bug
            Reporter: Trejkaz


MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.

It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doron Cohen updated LUCENE-1213:
--------------------------------

    Attachment: multifield-fix.patch

Trekaj thanks for the patch. 

Attached a slightly compacted fix (refactoring slop-applying to a separate method).
Also added a test that fails without this fix.

All tests pass, if there are no comments I will commit this in a day or two.

> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>            Assignee: Doron Cohen
>         Attachments: multifield-fix.patch, multifield-fix.patch
>
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doron Cohen resolved LUCENE-1213.
---------------------------------

       Resolution: Fixed
    Lucene Fields: [Patch Available]  (was: [New])

Committed, thanks Trejkaz!

> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>            Assignee: Doron Cohen
>         Attachments: multifield-fix.patch, multifield-fix.patch
>
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576880#action_12576880 ] 

doronc edited comment on LUCENE-1213 at 3/11/08 1:00 AM:
--------------------------------------------------------------

Trejkaz thanks for the patch. 

Attached a slightly compacted fix (refactoring slop-applying to a separate method).
Also added a test that fails without this fix.

All tests pass, if there are no comments I will commit this in a day or two.

      was (Author: doronc):
    Trekaj thanks for the patch. 

Attached a slightly compacted fix (refactoring slop-applying to a separate method).
Also added a test that fails without this fix.

All tests pass, if there are no comments I will commit this in a day or two.
  
> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>            Assignee: Doron Cohen
>         Attachments: multifield-fix.patch, multifield-fix.patch
>
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doron Cohen reassigned LUCENE-1213:
-----------------------------------

    Assignee: Doron Cohen

> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>            Assignee: Doron Cohen
>         Attachments: multifield-fix.patch
>
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Trejkaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trejkaz updated LUCENE-1213:
----------------------------

    Component/s: QueryParser

> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1213) MultiFieldQueryParser ignores slop parameter

Posted by "Trejkaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trejkaz updated LUCENE-1213:
----------------------------

    Attachment: multifield-fix.patch

Attaching one possible fix.  It's more verbose than I wish it could be, but I couldn't think of a reliable way to make it delegate as it would require casting the result to BooleanQuery to get the clauses our, and a subclass may return something else entirely.


> MultiFieldQueryParser ignores slop parameter
> --------------------------------------------
>
>                 Key: LUCENE-1213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1213
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>            Reporter: Trejkaz
>         Attachments: multifield-fix.patch
>
>
> MultiFieldQueryParser.getFieldQuery(String, String, int) calls super.getFieldQuery(String, String), thus obliterating any slop parameter present in the query.
> It should probably be changed to call super.getFieldQuery(String, String, int), except doing only that will result in a recursive loop which is a side-effect of what may be a deeper problem in MultiFieldQueryParser -- getFieldQuery(String, String, int) is documented as delegating to getFieldQuery(String, String), yet what it actually does is the exact opposite.  This also causes problems for subclasses which need to override getFieldQuery(String, String) to provide different behaviour.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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