Lucene - Core
  1. Lucene - Core
  2. LUCENE-6588

ToChildBlockJoinQuery does not calculate parent score if the first child is not in acceptDocs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.3
    • Component/s: modules/join
    • Labels:
      None

      Description

      There is a bug in ToChildBlockJoinQuery that causes the score calculation to be skipped if the first child of a new parent doc is not in acceptDocs.

      I will attach test showing the failure and a patch to fix it.

        Activity

        Hide
        Christoph Kaser added a comment -

        Test demonstrating the bug

        Show
        Christoph Kaser added a comment - Test demonstrating the bug
        Hide
        Christoph Kaser added a comment - - edited

        Patch for the issue

        Show
        Christoph Kaser added a comment - - edited Patch for the issue
        Hide
        Christoph Kaser added a comment -

        This patch implements ToChildBlockJoinQuery.explain(), which helped finding and debugging this issue

        Show
        Christoph Kaser added a comment - This patch implements ToChildBlockJoinQuery.explain(), which helped finding and debugging this issue
        Hide
        ASF GitHub Bot added a comment -

        GitHub user ChristophKaser opened a pull request:

        https://github.com/apache/lucene-solr/pull/155

        To child block join query fixes

        Pull request for LUCENE-6588

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/ChristophKaser/lucene-solr ToChildBlockJoinQueryFixes

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/lucene-solr/pull/155.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #155


        commit 1242d581519cb01e12a8f32eec89bfdccecad1d8
        Author: ChristophKaser <berlin@caser.de>
        Date: 2015-06-19T11:42:54Z

        Test score calculation

        test whether all hits have scores when there are some deleted child
        documents (LUCENE-6588)

        commit eb9fc9243df085b4324e9f71e3f6d69059924be7
        Author: ChristophKaser <berlin@caser.de>
        Date: 2015-06-19T11:53:22Z

        ToChildBlockJoinQuery score calculation bugfix

        Don't skip score calculation if first child is not in acceptDocs.

        commit 45ed3c5674a9b6c42ad6669dc57a98eee86e000a
        Author: ChristophKaser <berlin@caser.de>
        Date: 2015-06-19T12:03:34Z

        implements ToChildBlockJoinQuery.explain()


        Show
        ASF GitHub Bot added a comment - GitHub user ChristophKaser opened a pull request: https://github.com/apache/lucene-solr/pull/155 To child block join query fixes Pull request for LUCENE-6588 You can merge this pull request into a Git repository by running: $ git pull https://github.com/ChristophKaser/lucene-solr ToChildBlockJoinQueryFixes Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/155.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #155 commit 1242d581519cb01e12a8f32eec89bfdccecad1d8 Author: ChristophKaser <berlin@caser.de> Date: 2015-06-19T11:42:54Z Test score calculation test whether all hits have scores when there are some deleted child documents ( LUCENE-6588 ) commit eb9fc9243df085b4324e9f71e3f6d69059924be7 Author: ChristophKaser <berlin@caser.de> Date: 2015-06-19T11:53:22Z ToChildBlockJoinQuery score calculation bugfix Don't skip score calculation if first child is not in acceptDocs. commit 45ed3c5674a9b6c42ad6669dc57a98eee86e000a Author: ChristophKaser <berlin@caser.de> Date: 2015-06-19T12:03:34Z implements ToChildBlockJoinQuery.explain()
        Hide
        Adrien Grand added a comment -

        I don't think we should try to support fine-grained deletion of children documents. I would rather like blocks of documents to be not only added but also deleted atomically so that a parent and its children are either all live or all deleted.

        Show
        Adrien Grand added a comment - I don't think we should try to support fine-grained deletion of children documents. I would rather like blocks of documents to be not only added but also deleted atomically so that a parent and its children are either all live or all deleted.
        Hide
        Christoph Kaser added a comment -

        When I encountered this bug, there was no deleted document in the index - I think acceptDocs was set due to a filter. So the bug is relevant whether or not deleting single children is a supported use case.
        However, the easiest way to reproduce the bug was by deleting child documents, so that's what I used.

        Show
        Christoph Kaser added a comment - When I encountered this bug, there was no deleted document in the index - I think acceptDocs was set due to a filter. So the bug is relevant whether or not deleting single children is a supported use case. However, the easiest way to reproduce the bug was by deleting child documents, so that's what I used.
        Hide
        Adrien Grand added a comment -

        OK I see, this was FilteredQuery using RANDOM_ACCESS_FILTER_STRATEGY to apply a filter as acceptDocs.

        Show
        Adrien Grand added a comment - OK I see, this was FilteredQuery using RANDOM_ACCESS_FILTER_STRATEGY to apply a filter as acceptDocs.
        Hide
        Christoph Kaser added a comment -

        Okay, if you prefer I can change the test to use a FilteredQuery instead of deleting child documents

        Show
        Christoph Kaser added a comment - Okay, if you prefer I can change the test to use a FilteredQuery instead of deleting child documents
        Hide
        Adrien Grand added a comment -

        It's good to me this way, I had just forgotten that some child documents could seem deleted because of FilteredQuery. The patch looks good to me so I'll run more tests tomorrow and commit if there are no objections.

        Show
        Adrien Grand added a comment - It's good to me this way, I had just forgotten that some child documents could seem deleted because of FilteredQuery. The patch looks good to me so I'll run more tests tomorrow and commit if there are no objections.
        Hide
        ASF subversion and git services added a comment -

        Commit 1687049 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1687049 ]

        LUCENE-6588: Fixed how ToChildBlockJoinQuery deals with acceptDocs.

        Close #155

        Show
        ASF subversion and git services added a comment - Commit 1687049 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1687049 ] LUCENE-6588 : Fixed how ToChildBlockJoinQuery deals with acceptDocs. Close #155
        Hide
        ASF subversion and git services added a comment -

        Commit 1687059 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1687059 ]

        LUCENE-6588: Fixed how ToChildBlockJoinQuery deals with acceptDocs.

        Show
        ASF subversion and git services added a comment - Commit 1687059 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1687059 ] LUCENE-6588 : Fixed how ToChildBlockJoinQuery deals with acceptDocs.
        Hide
        Adrien Grand added a comment -

        Thanks Christoph, I just committed your patch!

        Show
        Adrien Grand added a comment - Thanks Christoph, I just committed your patch!
        Hide
        Christoph Kaser added a comment -

        Thank you!

        Show
        Christoph Kaser added a comment - Thank you!
        Hide
        ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/lucene-solr/pull/155

        Show
        ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/lucene-solr/pull/155
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk close for 5.3.0 release

        Show
        Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

          People

          • Assignee:
            Unassigned
            Reporter:
            Christoph Kaser
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development