Lucene - Core
  1. Lucene - Core
  2. LUCENE-6646

make the EarlyTerminatingSortingCollector constructor SortingMergePolicy-free

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      motivation and summary of proposed changes to follow via github pull request

        Issue Links

          Activity

          Hide
          ASF GitHub Bot added a comment -

          GitHub user cpoerschke opened a pull request:

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

          support SortingMergePolicy-free use of EarlyTerminatingSortingCollector

          for https://issues.apache.org/jira/i#browse/LUCENE-6646

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

          $ git pull https://github.com/bloomberg/lucene-solr trunk-sort-outline-lucene

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

          https://github.com/apache/lucene-solr/pull/175.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 #175


          commit 5984692c660b32ddec0260e5a096b7b7eea5ea8d
          Author: Christine Poerschke <cpoerschke@bloomberg.net>
          Date: 2015-06-29T15:02:44Z

          LUCENE-????: support SortingMergePolicy-free use of EarlyTerminatingSortingCollector

          motivation:

          • SOLR-5730 to make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector configurable in Solr.
          • outline of draft SOLR-5730 changes:
            + SolrIndexWriter constructor calls SolrIndexConfig.toIndexWriterConfig (passing the result to its lucene.IndexWriter super class)
            + SolrIndexConfig.toIndexWriterConfig(SolrCore core) calls SolrIndexConfig.buildMergePolicy
            + SolrIndexConfig.buildMergePolicy(IndexSchema schema) calls the SortingMergePolicy constructor (using the IndexSchema's mergeSortSpec)
            + SolrIndexSearcher.buildAndRunCollectorChain calls the EarlyTerminatingSortingCollector constructor (using the IndexSchema's mergeSortSpec)

          summary of changes:

          • added static isSorted variant to SortingMergePolicy
          • added SortingMergePolicy-free EarlyTerminatingSortingCollector constructor variant
          • added SortingMergePolicy-free EarlyTerminatingSortingCollector.canEarlyTerminate variant
          • corresponding changes to TestEarlyTerminatingSortingCollector (randomly choose between constructor and canEarlyTerminate variants)

          Show
          ASF GitHub Bot added a comment - GitHub user cpoerschke opened a pull request: https://github.com/apache/lucene-solr/pull/175 support SortingMergePolicy-free use of EarlyTerminatingSortingCollector for https://issues.apache.org/jira/i#browse/LUCENE-6646 You can merge this pull request into a Git repository by running: $ git pull https://github.com/bloomberg/lucene-solr trunk-sort-outline-lucene Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/175.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 #175 commit 5984692c660b32ddec0260e5a096b7b7eea5ea8d Author: Christine Poerschke <cpoerschke@bloomberg.net> Date: 2015-06-29T15:02:44Z LUCENE-????: support SortingMergePolicy-free use of EarlyTerminatingSortingCollector motivation: SOLR-5730 to make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector configurable in Solr. outline of draft SOLR-5730 changes: + SolrIndexWriter constructor calls SolrIndexConfig.toIndexWriterConfig (passing the result to its lucene.IndexWriter super class) + SolrIndexConfig.toIndexWriterConfig(SolrCore core) calls SolrIndexConfig.buildMergePolicy + SolrIndexConfig.buildMergePolicy(IndexSchema schema) calls the SortingMergePolicy constructor (using the IndexSchema's mergeSortSpec) + SolrIndexSearcher.buildAndRunCollectorChain calls the EarlyTerminatingSortingCollector constructor (using the IndexSchema's mergeSortSpec) summary of changes: added static isSorted variant to SortingMergePolicy added SortingMergePolicy-free EarlyTerminatingSortingCollector constructor variant added SortingMergePolicy-free EarlyTerminatingSortingCollector.canEarlyTerminate variant corresponding changes to TestEarlyTerminatingSortingCollector (randomly choose between constructor and canEarlyTerminate variants)
          Hide
          Adrien Grand added a comment -

          Thanks for the pull request, I see why you would not like to keep the merge policy around, just to get a Sort object. Then let's remove entirely the EarlyTerminatingSortingCollector constructor that takes a SortingMergePolicy and only keep the one that takes a Sort object?

          Show
          Adrien Grand added a comment - Thanks for the pull request, I see why you would not like to keep the merge policy around, just to get a Sort object. Then let's remove entirely the EarlyTerminatingSortingCollector constructor that takes a SortingMergePolicy and only keep the one that takes a Sort object?
          Hide
          Christine Poerschke added a comment -

          Hi Adrien Grand - thanks for the quick feedback on the pull request, i will make changes as suggested and update the pull request accordingly. - Christine

          Show
          Christine Poerschke added a comment - Hi Adrien Grand - thanks for the quick feedback on the pull request, i will make changes as suggested and update the pull request accordingly. - Christine
          Hide
          Christine Poerschke added a comment -

          Regarding SortingMergePolicy's existing non-static isSorted method, should we keep it around or could the equivalent static method be its replacement? Code fragment from pull request is this:

            /** Returns {@code true} if the given {@code reader} is sorted by the
             *  {@code sort} order of this {@link SortingMergePolicy}. */
            public boolean isSorted(LeafReader reader) {
              return isSorted(reader, sort);
            }
            
            /** Returns {@code true} if the given {@code reader} is sorted by the
             *  {@code sort} given. */
            public static boolean isSorted(LeafReader reader, Sort sort) {
              String description = getSortDescription(reader);
              if (description != null && description.equals(sort.toString())) {
                return true;
              }
              return false;
            }
          
          Show
          Christine Poerschke added a comment - Regarding SortingMergePolicy 's existing non-static isSorted method, should we keep it around or could the equivalent static method be its replacement? Code fragment from pull request is this: /** Returns {@code true } if the given {@code reader} is sorted by the * {@code sort} order of this {@link SortingMergePolicy}. */ public boolean isSorted(LeafReader reader) { return isSorted(reader, sort); } /** Returns {@code true } if the given {@code reader} is sorted by the * {@code sort} given. */ public static boolean isSorted(LeafReader reader, Sort sort) { String description = getSortDescription(reader); if (description != null && description.equals(sort.toString())) { return true ; } return false ; }
          Hide
          Adrien Grand added a comment -

          I'm good with only keeping the static version. Maybe add a javadoc link to SortingMergePolicy#getSort() ?

          Show
          Adrien Grand added a comment - I'm good with only keeping the static version. Maybe add a javadoc link to SortingMergePolicy#getSort() ?
          Hide
          Christine Poerschke added a comment -

          javadoc link to SortingMergePolicy#getSort() - good idea, will do.

          Show
          Christine Poerschke added a comment - javadoc link to SortingMergePolicy#getSort() - good idea, will do.
          Hide
          ASF GitHub Bot added a comment -

          GitHub user cpoerschke opened a pull request:

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

          LUCENE-6646: SortingMergePolicy-free EarlyTerminatingSortingCollector constructor

          for https://issues.apache.org/jira/i#browse/LUCENE-6646

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

          $ git pull https://github.com/bloomberg/lucene-solr trunk-etsc-lucene

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

          https://github.com/apache/lucene-solr/pull/178.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 #178


          commit 7881a5931cf8db8a76f1aee9ca747f6b8de2a63a
          Author: Christine Poerschke <cpoerschke@bloomberg.net>
          Date: 2015-06-29T15:02:44Z

          LUCENE-6646: make the EarlyTerminatingSortingCollector constructor SortingMergePolicy-free

          motivation:

          • SOLR-5730 to make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector configurable in Solr.
          • outline of draft SOLR-5730 changes:
            + SolrIndexWriter constructor calls SolrIndexConfig.toIndexWriterConfig (passing the result to its lucene.IndexWriter super class)
            + SolrIndexConfig.toIndexWriterConfig(SolrCore core) calls SolrIndexConfig.buildMergePolicy
            + SolrIndexConfig.buildMergePolicy(IndexSchema schema) calls the SortingMergePolicy constructor (using the IndexSchema's mergeSortSpec)
            + SolrIndexSearcher.buildAndRunCollectorChain calls the EarlyTerminatingSortingCollector constructor (using the IndexSchema's mergeSortSpec)

          summary of changes:

          • made SortingMergePolicy's isSorted into a static function
          • made EarlyTerminatingSortingCollector's constructor SortingMergePolicy-free, class summary docs updated to match
          • adjusted EarlyTerminatingSortingCollector.canEarlyTerminate to be SortingMergePolicy-free also
          • corresponding changes to TestEarlyTerminatingSortingCollector
          • adjusted AnalyzingInfixSuggester's EarlyTerminatingSortingCollector constructor call

          Show
          ASF GitHub Bot added a comment - GitHub user cpoerschke opened a pull request: https://github.com/apache/lucene-solr/pull/178 LUCENE-6646 : SortingMergePolicy-free EarlyTerminatingSortingCollector constructor for https://issues.apache.org/jira/i#browse/LUCENE-6646 You can merge this pull request into a Git repository by running: $ git pull https://github.com/bloomberg/lucene-solr trunk-etsc-lucene Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/178.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 #178 commit 7881a5931cf8db8a76f1aee9ca747f6b8de2a63a Author: Christine Poerschke <cpoerschke@bloomberg.net> Date: 2015-06-29T15:02:44Z LUCENE-6646 : make the EarlyTerminatingSortingCollector constructor SortingMergePolicy-free motivation: SOLR-5730 to make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector configurable in Solr. outline of draft SOLR-5730 changes: + SolrIndexWriter constructor calls SolrIndexConfig.toIndexWriterConfig (passing the result to its lucene.IndexWriter super class) + SolrIndexConfig.toIndexWriterConfig(SolrCore core) calls SolrIndexConfig.buildMergePolicy + SolrIndexConfig.buildMergePolicy(IndexSchema schema) calls the SortingMergePolicy constructor (using the IndexSchema's mergeSortSpec) + SolrIndexSearcher.buildAndRunCollectorChain calls the EarlyTerminatingSortingCollector constructor (using the IndexSchema's mergeSortSpec) summary of changes: made SortingMergePolicy's isSorted into a static function made EarlyTerminatingSortingCollector's constructor SortingMergePolicy-free, class summary docs updated to match adjusted EarlyTerminatingSortingCollector.canEarlyTerminate to be SortingMergePolicy-free also corresponding changes to TestEarlyTerminatingSortingCollector adjusted AnalyzingInfixSuggester's EarlyTerminatingSortingCollector constructor call
          Hide
          ASF subversion and git services added a comment -

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

          LUCENE-6646: Make EarlyTerminatingCollector SortingMergePolicy-free.

          Close #175
          Close #178

          Show
          ASF subversion and git services added a comment - Commit 1688894 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1688894 ] LUCENE-6646 : Make EarlyTerminatingCollector SortingMergePolicy-free. Close #175 Close #178
          Hide
          ASF subversion and git services added a comment -

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

          LUCENE-6646: Make EarlyTerminatingCollector SortingMergePolicy-free.

          Show
          ASF subversion and git services added a comment - Commit 1688895 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1688895 ] LUCENE-6646 : Make EarlyTerminatingCollector SortingMergePolicy-free.
          Hide
          Adrien Grand added a comment -

          I just committed the change. Thanks Christine!

          Show
          Adrien Grand added a comment - I just committed the change. Thanks Christine!
          Hide
          ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

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

          Github user asfgit closed the pull request at:

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

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

            People

            • Assignee:
              Unassigned
              Reporter:
              Christine Poerschke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development