You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "chatman (via GitHub)" <gi...@apache.org> on 2025/01/22 08:56:27 UTC

[PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

chatman opened a new pull request, #3053:
URL: https://github.com/apache/solr/pull/3053

   [SOLR-17631](https://issues.apache.org/jira/browse/SOLR-17631)
   
   Upgrade main to Lucene 10.x
   
   Right now, I've fixed all compilation issues with core and test modules. Other modules still don't compile.
   On the tests front, I've fixed a few tests. There are the tests that still fail:
   
   ```
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.DisMaxRequestHandlerTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.update.processor.PreAnalyzedUpdateProcessorTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestRandomDVFaceting.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.DistributedIntervalFacetingTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.analysis.TestReversedWildcardFilterFactory.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestGroupingSearch.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestJoin.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.analysis.PathHierarchyTokenizerFactoryTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestDistributedSearch.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.BasicFunctionalityTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestDistributedGrouping.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.TestRandomFaceting.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.cloud.BasicDistributedZkTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.cloud.BasicDistributedZk2Test.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.cloud.DocValuesNotIndexedTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.TestSnapshotCoreBackup.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DistributedSpellCheckComponentTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.cloud.TestSegmentSorting.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DebugComponentTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DistributedFacetPivotLargeTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DistributedFacetPivotWhiteBoxTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestTrieFacet.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.core.TestCodecSupport.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.facet.TestCloudJSONFacetSKG.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.core.SOLR749Test.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.designer.TestSchemaDesignerAPI.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.spelling.SpellCheckCollatorTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.uninverting.TestFieldCacheVsDocValues.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.update.SolrIndexConfigTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DistributedFacetPivotSmallTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.facet.TestCloudJSONFacetJoinDomain.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.DistributedFacetPivotSmallAdvancedTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.request.TestIntervalFaceting.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.uninverting.TestFieldCacheSortRandom.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.schema.PreAnalyzedFieldTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.QueryElevationComponentTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.StatsComponentTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestComplexPhraseLeadingWildcard.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestMissingGroups.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestRealTimeGet.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.request.TestWriterPerf.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.facet.TestJsonFacetRefinement.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.request.SimpleFacetsTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.response.TestRetrieveFieldsOptimizer.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.schema.DocValuesMultiTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.MoreLikeThisHandlerTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.LargeFieldTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.schema.TestUseDocValuesAsStored.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.FacetPivotSmallTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.request.TestFaceting.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestDocValuesIteratorCache.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestQueryLimits.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestGraphTermsQParserPlugin.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestFiltering.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.uninverting.TestDocTermOrds.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.facet.TestCloudJSONFacetSKGEquiv.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.json.TestJsonRequest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.search.TestSmileRequest.txt```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by Ishan Chattopadhyaya <ic...@gmail.com>.
Thanks for looking into this, Jason. I'll be back working on the by the end
of April.

On Sat, 19 Apr, 2025, 12:33 am gerlowskija (via GitHub), <gi...@apache.org>
wrote:

>
> gerlowskija commented on code in PR #3053:
> URL: https://github.com/apache/solr/pull/3053#discussion_r2050996506
>
>
> ##########
>
> solr/core/src/test/org/apache/solr/legacy/TestMultiValuedNumericRangeQuery.java:
> ##########
> @@ -79,16 +76,16 @@ public void testMultiValuedNRQ() throws Exception {
>                "asc", format.format(lower), format.format(upper), true,
> true);
>        LegacyNumericRangeQuery<Integer> tq =
>            LegacyNumericRangeQuery.newIntRange("trie", lower, upper, true,
> true);
> -      TopScoreDocCollector trCollector = TopScoreDocCollector.create(1,
> Integer.MAX_VALUE);
> -      TopScoreDocCollector nrCollector = TopScoreDocCollector.create(1,
> Integer.MAX_VALUE);
> +      TopScoreDocCollector trCollector = new
> TopScoreDocCollectorManager(1, Integer.MAX_VALUE).newCollector();
>
> Review Comment:
>    ditto, re: "Collector vs. CollectorManager"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050713245)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
> ##########
> @@ -183,12 +175,12 @@ private void testRange(int precisionStep) throws
> Exception {
>        ScoreDoc[] sd = topDocs.scoreDocs;
>        assertNotNull(sd);
>        assertEquals("Score doc count" + type, count, sd.length);
> -      Document doc = searcher.doc(sd[0].doc);
> +      Document doc = searcher.storedFields().document(sd[0].doc);
>
> Review Comment:
>    ditto, re: "IndexSearcher.doc removal/replacement"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050986335)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
> ##########
> @@ -160,20 +153,19 @@ private void testRange(int precisionStep) throws
> Exception {
>      String field = "field" + precisionStep;
>      int count = 3000;
>      int lower = (distance * 3 / 2) + startOffset, upper = lower + count *
> distance + (distance / 3);
> -    LegacyNumericRangeQuery<Integer> q =
> -        LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower,
> upper, true, true);
> +    LegacyNumericRangeQuery<Integer> q;
>      for (byte i = 0; i < 2; i++) {
>        TopFieldCollector collector =
> -          TopFieldCollector.create(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE);
> +          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE).newCollector();
>
> Review Comment:
>    ditto, re: "Collector vs. CollectorManager"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050713245)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/handler/tagger/TaggerTestCase.java:
> ##########
> @@ -139,11 +140,12 @@ protected TestTag[]
> pullTagsFromResponse(SolrQueryRequest req, SolrQueryResponse
>      NamedList<?> rspValues = rsp.getValues();
>      Map<String, String> matchingNames = new HashMap<>();
>      SolrIndexSearcher searcher = req.getSearcher();
> +    SolrDocumentFetcher docFetcher = searcher.getDocFetcher();
>      DocList docList = (DocList) rspValues.get("response");
>      DocIterator iter = docList.iterator();
>      while (iter.hasNext()) {
>        int docId = iter.next();
> -      Document doc = searcher.doc(docId);
> +      Document doc = docFetcher.doc(docId);
>
> Review Comment:
>    ditto, re: "IndexSearcher.doc removal/replacement"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050986335)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
> ##########
> @@ -172,20 +165,19 @@ private void testRange(int precisionStep) throws
> Exception {
>      int count = 3000;
>      long lower = (distance * 3 / 2) + startOffset,
>          upper = lower + count * distance + (distance / 3);
> -    LegacyNumericRangeQuery<Long> q =
> -        LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower,
> upper, true, true);
> +    LegacyNumericRangeQuery<Long> q;
>      for (byte i = 0; i < 2; i++) {
>        TopFieldCollector collector =
> -          TopFieldCollector.create(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE);
> +          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE).newCollector();
>
> Review Comment:
>    ditto, re: "Collector vs. CollectorManager"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050713245)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
> ##########
> @@ -160,20 +153,19 @@ private void testRange(int precisionStep) throws
> Exception {
>      String field = "field" + precisionStep;
>      int count = 3000;
>      int lower = (distance * 3 / 2) + startOffset, upper = lower + count *
> distance + (distance / 3);
> -    LegacyNumericRangeQuery<Integer> q =
> -        LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower,
> upper, true, true);
> +    LegacyNumericRangeQuery<Integer> q;
>      for (byte i = 0; i < 2; i++) {
>        TopFieldCollector collector =
> -          TopFieldCollector.create(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE);
> +          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE).newCollector();
>        String type;
>        switch (i) {
>          case 0:
>            type = " (constant score filter rewrite)";
> -          q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE);
> +          q = LegacyNumericRangeQuery.newIntRange(field, precisionStep,
> lower, upper, true, true, MultiTermQuery.CONSTANT_SCORE_REWRITE);
>
> Review Comment:
>    ditto, re: "RewriteMethod in ctor"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050746215)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/LargeFieldTest.java:
> ##########
> @@ -96,7 +96,7 @@ public void test() throws Exception {
>      assertQ(req("q", "101", "df", ID_FLD, "fl", ID_FLD)); // eager load
> ID_FLD; rest are lazy
>
>      // fetch the document; we know it will be from the documentCache,
> docId 0
> -    final Document d = h.getCore().withSearcher(searcher ->
> searcher.doc(0));
> +    final Document d = h.getCore().withSearcher(searcher ->
> searcher.storedFields().document(0));
>
> Review Comment:
>    ditto, re: "IndexSearcher.doc removal/replacement"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050986335)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestCancellableCollector.java:
> ##########
> @@ -96,7 +88,7 @@ public void tearDown() throws Exception {
>
>    private CancellableCollector buildCancellableCollector(
>        final int numHits, boolean delayStart, boolean delayCollection) {
> -    TopScoreDocCollector topScoreDocCollector =
> TopScoreDocCollector.create(numHits, null, 1);
> +    TopScoreDocCollector topScoreDocCollector = new
> TopScoreDocCollectorManager(numHits, null, 1).newCollector();
>
> Review Comment:
>    ditto, re: "Collector vs. CollectorManager"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050713245)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
> ##########
> @@ -172,20 +165,19 @@ private void testRange(int precisionStep) throws
> Exception {
>      int count = 3000;
>      long lower = (distance * 3 / 2) + startOffset,
>          upper = lower + count * distance + (distance / 3);
> -    LegacyNumericRangeQuery<Long> q =
> -        LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower,
> upper, true, true);
> +    LegacyNumericRangeQuery<Long> q;
>      for (byte i = 0; i < 2; i++) {
>        TopFieldCollector collector =
> -          TopFieldCollector.create(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE);
> +          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs,
> Integer.MAX_VALUE).newCollector();
>        String type;
>        switch (i) {
>          case 0:
>            type = " (constant score filter rewrite)";
> -          q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE);
> +          q = LegacyNumericRangeQuery.newLongRange(field, precisionStep,
> lower, upper, true, true, MultiTermQuery.CONSTANT_SCORE_REWRITE);
>
> Review Comment:
>    ditto, re: "RewriteMethod in ctor"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050746215)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestCancellableCollector.java:
> ##########
> @@ -114,7 +106,7 @@ private void executeSearchTest(
>      TopScoreDocCollector topScoreDocCollector =
>          (TopScoreDocCollector)
> internalCancellableCollector.getInternalCollector();
>
> -    assertEquals(topDocs.totalHits.value,
> topScoreDocCollector.getTotalHits());
> +    assertEquals(topDocs.totalHits.value(),
> topScoreDocCollector.getTotalHits());
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestDocSet.java:
> ##########
> @@ -363,6 +339,11 @@ public NumericDocValues getNormValues(String field) {
>          return null;
>        }
>
> +      @Override
>
> Review Comment:
>    ditto, re: "sparse index skip list capability"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050785064)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/schema/MyCrazyCustomField.java:
> ##########
> @@ -51,8 +51,7 @@ public Query getPrefixQuery(QParser parser, SchemaField
> sf, String termStr) {
>        termStr = "foo";
>      }
>
> -    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr));
> -    query.setRewriteMethod(sf.getType().getRewriteMethod(parser, sf));
> +    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr),
> sf.getType().getRewriteMethod(parser, sf));
>
> Review Comment:
>    ditto, re: "RewriteMethod in ctor"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050746215)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java:
> ##########
> @@ -125,7 +115,7 @@ public void testNullDocIdSet() throws Exception {
>
>      // First verify the document is searchable.
>      IndexSearcher searcher = newSearcher(reader);
> -    assertEquals(1, searcher.search(new MatchAllDocsQuery(),
> 10).totalHits.value);
> +    assertEquals(1, searcher.search(new MatchAllDocsQuery(),
> 10).totalHits.value());
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
> ##########
> @@ -195,12 +187,12 @@ private void testRange(int precisionStep) throws
> Exception {
>        ScoreDoc[] sd = topDocs.scoreDocs;
>        assertNotNull(sd);
>        assertEquals("Score doc count" + type, count, sd.length);
> -      Document doc = searcher.doc(sd[0].doc);
> +      Document doc = searcher.storedFields().document(sd[0].doc);
>
> Review Comment:
>    ditto, re: "IndexSearcher.doc removal/replacement"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050986335)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java:
> ##########
> @@ -96,14 +96,13 @@ public void testDocValues() throws IOException {
>          assertEquals(0, dv.nextDoc());
>          assertEquals(0, dv.nextOrd());
>          assertEquals(1, dv.nextOrd());
> -        assertEquals(SortedSetDocValues.NO_MORE_ORDS, dv.nextOrd());
> +        assertEquals(2, dv.docValueCount());
>
> Review Comment:
>    ditto, re: "docValue iteration"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050762921)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestMinHashQParser.java:
> ##########
> @@ -424,7 +424,7 @@ public void testBandsWrap() throws SyntaxError {
>      assertEquals(4, bq.clauses().size());
>      for (BooleanClause clause : bq.clauses()) {
>        assertEquals(
> -          3, ((BooleanQuery) ((ConstantScoreQuery)
> clause.getQuery()).getQuery()).clauses().size());
> +          3, ((BooleanQuery) ((ConstantScoreQuery)
> clause.query()).getQuery()).clauses().size());
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java:
> ##########
> @@ -3158,7 +3158,7 @@ private boolean containsClause(FuzzyQuery query,
> String field, String value) {
>    private boolean containsClause(
>        BooleanQuery query, String field, String value, int boost, boolean
> fuzzy) {
>      for (BooleanClause clause : query) {
> -      if (containsClause(clause.getQuery(), field, value, boost, fuzzy)) {
> +      if (containsClause(clause.query(), field, value, boost, fuzzy)) {
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java:
> ##########
> @@ -166,7 +156,7 @@ public Explanation explain(LeafReaderContext context,
> int doc) {
>                }
>
>                @Override
> -              public Scorer scorer(LeafReaderContext leafReaderContext) {
> +              public ScorerSupplier scorerSupplier(LeafReaderContext
> leafReaderContext) {
>
> Review Comment:
>    ditto, re: "Scorer vs. ScorerSupplier"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050863372)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java:
> ##########
> @@ -123,8 +123,8 @@ public void testHandyQuery() throws ParserException {
>      assertTrue(query instanceof BooleanQuery);
>      final BooleanQuery bq = (BooleanQuery) query;
>      assertEquals(2, bq.clauses().size());
> -    assertTrue(bq.clauses().get(0).getQuery() instanceof
> MatchAllDocsQuery);
> -    assertTrue(bq.clauses().get(1).getQuery() instanceof
> MatchNoDocsQuery);
> +    assertTrue(bq.clauses().get(0).query() instanceof MatchAllDocsQuery);
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> ##########
> solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java:
> ##########
> @@ -88,10 +88,10 @@ public void testPureMax() {
>      q = parse("foo bar");
>      clauses = clauses(q);
>      assertEquals(1, clauses.length);
> -    assertTrue(clauses[0].getQuery() instanceof DisjunctionMaxQuery);
> +    assertTrue(clauses[0].query() instanceof DisjunctionMaxQuery);
>
> Review Comment:
>    ditto, re: "Lucene movement towards Java 'records'"
>
>    See [comment here](
> https://github.com/apache/solr/pull/3053#discussion_r2050683426)
>
>
>
> --
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
>
> To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
> For additional commands, e-mail: issues-help@solr.apache.org
>
>

Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2816864402

   Alright, I've merged in the latest main and tackled a few test failures.  Here are the remaining failures as a check-box list that we can update as we progress:
   
   - [ ] org.apache.solr.TestDistributedGrouping
   - [ ] org.apache.solr.TestGroupingSearch
   - [ ] org.apache.solr.TestJoin
   - [ ] org.apache.solr.analysis.PathHierarchyTokenizerFactoryTest
   - [ ] org.apache.solr.cloud.TestPullReplicaErrorHandling (likely an existing flaky issue)
   - [ ] org.apache.solr.handler.component.DistributedSpellCheckComponentTest
   - [ ] org.apache.solr.handler.component.QueryElevationComponentTest
   - [ ] org.apache.solr.ltr.feature.TestFeatureLogging
   - [ ] org.apache.solr.schema.PreAnalyzedFieldTest
   - [ ] org.apache.solr.search.TestComplexPhraseLeadingWildcard
   - [ ] org.apache.solr.search.TestFiltering
   - [ ] org.apache.solr.search.TestGraphTermsQParserPlugin
   - [ ] org.apache.solr.search.TestQueryLimits
   - [ ] org.apache.solr.search.TestTermsQParserPlugin
   - [ ] org.apache.solr.uninverting.TestFieldCache
   - [ ] org.apache.solr.uninverting.TestFieldCacheVsDocValues
   - [ ] org.apache.solr.uninverting.TestUninvertingReader
   - [ ] org.apache.solr.update.processor.PreAnalyzedUpdateProcessorTest


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2676871185

   Looking forward to this landing.  I was just looking at upgrading OpenNLP and seeing that it requires Lucene 10...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2301573935


##########
solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java:
##########
@@ -97,7 +97,7 @@ public void init(NamedList<?> args) {
       log.debug("Using default compressionMode: {}", compressionMode);
     }
     codec =
-        new Lucene912Codec(compressionMode) {
+        new Lucene101Codec(compressionMode) {

Review Comment:
   oops silly me, there is no `Lucene102Codec` ... https://github.com/apache/lucene/tree/releases/lucene/10.2.2/lucene/core/src/java/org/apache/lucene/codecs/lucene102



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "liangkaiwen (via GitHub)" <gi...@apache.org>.
liangkaiwen commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3155495144

   Hello, also would like to help pitch in. My guess is the best thing we should do to parallelize/coordinate is to pick one of the remaining failing tests and announce that here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165201252

   >  Is the test you are talking about the: ltr_expensiveFeatureRescoring_shouldTimeOutAndReturnPartialResults?
   
   @aruggero yes. Apologies, since that was added by @alessandrobenedetti and I wrongly tagged you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165232514

   > But I've got to say, it's premature to merge a PR without either first seeking and getting another approval or to state your intention to merge in 48 hours. This isn't a triival PR (of course). I don't want other committers (esp. new ones) or contributors to think this is normal. It's not. The same thing happened with the multiThreaded PR, which didn't turn out well, as you know.
   
   Apache Solr still follows CTR policy [0]. If anyone has an objection, I'll revert my commits. This is the traditional process. This is not a trivial PR (of course), and I can't keep up with all the changes that keep happening on main.
   
   When there were failures on this branch, it was my problem (and Christine's and Jason's too). You can scroll up and review the comments. Now, after this merge, all problems out of this merge is a collective problem (which is good, IMHO).
   
   > The same thing happened with the multiThreaded PR, which didn't turn out well, as you know.
   If you want to blame me for something, I can as well blame others for the sorry state of affairs this project is currently in. This is not healthy. I'm back to Solr development to make things better, not blame others for past issues.
   
   [0] - https://infra.apache.org/new-committers-guide.html#the-committers-way


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3164575932

   I have rebased all the changes on current main, tried to compose them into relatively separate changes instead of lumping them into a single commit. However, still, the first commit contains majority of the changes, and then targeted fixes post that.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165435262

   > I'm only "blaming" you for not following a best practice (twice now) on big/important PRs. Nothing more. If neither broke things I wouldn't be happy but probably wouldn't have said anything.
   
   Yeah, cry me a river, while I fix stuff. I follow Apache's CTR policy based on my best judgement, and I don't have to argue about it.
   
   >  I don't think Anshum's proposed feature freeze date creates true urgency here but if you disagree then announce your plan to commit in 1 day.
   
   Look at the project's current state of affairs, I can see why there's no urgency ever (except when it comes to blaming others for fixing it).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2866359248

   Just ran the tests on this branch and saw these failures:
   ```
   TestSnapshotCoreBackup
   TestFiltering
   PreAnalyzedUpdateProcessorTest
   PathHierarchyTokenizerFactoryTest
   DistributedSpellCheckComponentTest
   TestFieldCacheSortRandom
   PreAnalyzedFieldTest
   TestGroupingSearch
   TestQueryLimits
   TestFieldCacheVsDocValues
   TestDistributedGrouping
   TestComplexPhraseLeadingWildcard
   TestRandomDVFaceting
   TestFieldCache
   QueryElevationComponentTest
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1928419378


##########
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java:
##########
@@ -22,7 +22,7 @@
 import java.io.UncheckedIOException;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.DocValuesFieldExistsQuery;
+import org.apache.lucene.search.FieldExistsQuery;

Review Comment:
   #2632 (draft) was/is about just removing deprecated `(DocValues,Norms)FieldExistsQuery` use (without Lucene dependency change).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1937402513


##########
solr/modules/ltr/src/test/org/apache/solr/ltr/TestLTRReRankingPipeline.java:
##########
@@ -145,8 +145,8 @@ public void testRescorer() throws Exception {
       hits = rescorer.rescore(searcher, hits, 2);
 
       // rerank using the field finalScore
-      assertEquals("1", searcher.doc(hits.scoreDocs[0].doc).get("id"));
-      assertEquals("0", searcher.doc(hits.scoreDocs[1].doc).get("id"));
+      assertEquals("1", searcher.storedFields().document(hits.scoreDocs[0].doc).get("id"));
+      assertEquals("0", searcher.storedFields().document(hits.scoreDocs[1].doc).get("id"));

Review Comment:
   Elsewhere outside of `modules/ltr` similar changes are needed too, #3149 proposes to separately replace.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2050834136


##########
solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java:
##########
@@ -1240,9 +1240,9 @@ && allSameQueryStructure(lst)) {
                   BooleanQuery booleanQuery = (BooleanQuery) boostQuery.getQuery();
                   subs.add(
                       new BoostQuery(
-                          booleanQuery.clauses().get(c).getQuery(), boostQuery.getBoost()));
+                          booleanQuery.clauses().get(c).query(), boostQuery.getBoost()));

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java:
##########
@@ -200,7 +189,7 @@ public int getCost() {
     public void setCost(int cost) {}
 
     @Override
-    public Query rewrite(IndexReader reader) throws IOException {
+    public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/Grouping.java:
##########
@@ -905,11 +868,11 @@ protected Collector createFirstPassCollector() throws IOException {
       Collector subCollector;
       if (withinGroupSort == null || withinGroupSort.equals(Sort.RELEVANCE)) {
         subCollector =
-            topCollector = TopScoreDocCollector.create(groupDocsToCollect, Integer.MAX_VALUE);
+            topCollector = new TopScoreDocCollectorManager(groupDocsToCollect, Integer.MAX_VALUE).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245) 



##########
solr/core/src/java/org/apache/solr/search/JoinQuery.java:
##########
@@ -330,7 +323,7 @@ public DocSet getDocSetEnumerate() throws IOException {
             for (int subindex = 0; subindex < numSubs; subindex++) {
               MultiPostingsEnum.EnumWithSlice sub = subs[subindex];
               if (sub.postingsEnum == null) continue;
-              int base = sub.slice.start;
+              int base = sub.slice.start();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java:
##########
@@ -521,39 +511,59 @@ private SegState getSegState(LeafReaderContext context) throws IOException {
       return segStates[context.ord] = new SegState(segSet);
     }
 
-    private Scorer scorer(DocIdSet set) throws IOException {
+    private Scorer scorerInternal(DocIdSet set) throws IOException {
       if (set == null) {
         return null;
       }
       final DocIdSetIterator disi = set.iterator();
       if (disi == null) {
         return null;
       }
-      return new ConstantScoreScorer(this, score(), scoreMode, disi);
+      return new ConstantScoreScorer(score(), scoreMode, disi);
     }
 
-    @Override
-    public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {
+    private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    public Scorer scorerInternal(LeafReaderContext context) throws IOException {
       final SegState weightOrBitSet = getSegState(context);
+      log.info("Query: " + getQuery());
+      log.info("weight: " + weightOrBitSet.weight);
+      if (weightOrBitSet.weight!=null) log.info("weight's scorer: " + weightOrBitSet.weight.scorer(context));
+      log.info("set: " + weightOrBitSet.set);
       if (weightOrBitSet.weight != null) {
-        return weightOrBitSet.weight.bulkScorer(context);
+        Scorer ret = weightOrBitSet.weight.scorer(context);
+        return ret;
       } else {
-        final Scorer scorer = scorer(weightOrBitSet.set);
-        if (scorer == null) {
-          return null;
-        }
-        return new DefaultBulkScorer(scorer);
+        return scorerInternal(weightOrBitSet.set);
       }
     }
 
     @Override
-    public Scorer scorer(LeafReaderContext context) throws IOException {
-      final SegState weightOrBitSet = getSegState(context);
-      if (weightOrBitSet.weight != null) {
-        return weightOrBitSet.weight.scorer(context);
-      } else {
-        return scorer(weightOrBitSet.set);
+    public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   [INFO] The "ScoreSupplier" interface and method was added to Lucene a while back as a way to do better query-planning for range queries, but https://github.com/apache/lucene/issues/13180 recently shifted the method to being "abstract" to force all Weight subclasses to implement it.
   
   `scorer(..)` now has a default implementation that delegates to scoreSupplier, so in effect most Weight impl's have had to switch out their `scorer(...)` method for a `scorerSupplier(...)`.



##########
solr/core/src/java/org/apache/solr/search/Grouping.java:
##########
@@ -437,32 +425,7 @@ public void execute() throws IOException {
    */
   private void searchWithTimeLimiter(final Query filterQuery, Collector collector)
       throws IOException {
-    if (cmd.getTimeAllowed() > 0) {
-      if (timeLimitingCollector == null) {
-        timeLimitingCollector =
-            new TimeLimitingCollector(
-                collector, TimeLimitingCollector.getGlobalCounter(), cmd.getTimeAllowed());
-      } else {
-        /*
-         * This is so the same timer can be used for grouping's multiple phases.
-         * We don't want to create a new TimeLimitingCollector for each phase because that would
-         * reset the timer for each phase.  If time runs out during the first phase, the
-         * second phase should timeout quickly.
-         */
-        timeLimitingCollector.setCollector(collector);
-      }
-      collector = timeLimitingCollector;
-    }
-    try {
-      searcher.search(QueryUtils.combineQueryAndFilter(query, filterQuery), collector);
-    } catch (TimeLimitingCollector.TimeExceededException
-        | ExitableDirectoryReader.ExitingReaderException x) {
-      // INFO log the (possibly quite long) query object separately
-      log.info("Query: {}; ", query);
-      // to make WARN logged exception content more visible
-      log.warn("Query: {}; ", query.getClass().getName(), x);
-      qr.setPartialResults(true);
-    }
+    searcher.search(filterQuery, collector);

Review Comment:
   [Q] Is this logic moving somewhere else?  I'm not sure how/why we're nuking all of this logic?



##########
solr/core/src/java/org/apache/solr/search/EarlyTerminatingSortingCollector.java:
##########
@@ -96,7 +96,7 @@ public EarlyTerminatingSortingCollector(Collector in, Sort sort, int numDocsToCo
 
   @Override
   public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
-    Sort segmentSort = context.reader().getMetaData().getSort();
+    Sort segmentSort = context.reader().getMetaData().sort();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/Grouping.java:
##########
@@ -623,8 +586,8 @@ protected NamedList<Object> commonResponse() {
     }
 
     protected DocList getDocList(GroupDocs<?> groups) {
-      assert groups.totalHits.relation == TotalHits.Relation.EQUAL_TO;
-      int max = Math.toIntExact(groups.totalHits.value);
+      assert groups.totalHits().relation() == TotalHits.Relation.EQUAL_TO;

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/MatchCostQuery.java:
##########
@@ -66,8 +57,8 @@ public int hashCode() {
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
-    final Query rewrite = delegate.rewrite(reader);
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/JoinQuery.java:
##########
@@ -80,9 +73,9 @@ public Query getQuery() {
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java:
##########
@@ -94,10 +94,10 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
     }
 
     @Override
-    public Query rewrite(IndexReader reader) throws IOException {
-      Query q = mainQuery.rewrite(reader);
+    public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/LegacyNumericRangeQueryBuilder.java:
##########
@@ -112,7 +113,7 @@ public Query getQuery(Element e) throws ParserException {
                 (lowerTerm == null ? null : Integer.valueOf(lowerTerm)),
                 (upperTerm == null ? null : Integer.valueOf(upperTerm)),
                 lowerInclusive,
-                upperInclusive);
+                upperInclusive, MultiTermQuery.CONSTANT_SCORE_REWRITE);

Review Comment:
   ditto, re: "RewriteMethod in ctor"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050746215)



##########
solr/core/src/java/org/apache/solr/search/MatchCostQuery.java:
##########
@@ -99,16 +90,16 @@ public Explanation explain(LeafReaderContext context, int doc) throws IOExceptio
       // scorer() so that we can wrap TPI
 
       @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
+      public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {
         final Scorer scorer = weight.scorer(context);
         if (scorer == null) {
           return null;
         }
         final TwoPhaseIterator tpi = scorer.twoPhaseIterator();
         if (tpi == null || tpi.matchCost() == matchCost) {
-          return scorer; // needn't wrap/delegate
+          return new SolrDefaultScorerSupplier(scorer); // needn't wrap/delegate
         }
-        return new Scorer(weight) { // pass delegated weight
+        return new SolrDefaultScorerSupplier(new Scorer() { // pass delegated weight

Review Comment:
   [Q] This doesn't actually use the delegated weight, as the comment suggests...is that intentional?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2267449944


##########
solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java:
##########
@@ -85,7 +85,6 @@ protected void doSetNextReader(LeafReaderContext context) throws IOException {
       FunctionValues dv = rangeFilt.getValueSource().getValues(fcontext, context);
       valueSourceScorer =
           dv.getRangeScorer(
-              weight,

Review Comment:
   Looks like `weight` can be removed now then: #3467



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1928902341


##########
solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java:
##########
@@ -476,7 +476,6 @@ private static class ScoreAndDoc extends Scorable {
         this.score = score;
       }
 
-      @Override
       public int docID() {
         return docid;
       }

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "ilariapet (via GitHub)" <gi...@apache.org>.
ilariapet commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3135621541

   Hello. Has anyone planned to resume work on this anytime soon? Planning to help, but I don't want to step on anybody's toes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263751291


##########
solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java:
##########
@@ -118,7 +118,7 @@ public void testTieredMPSolrIndexConfigCreation() throws Exception {
     ConcurrentMergeScheduler ms = (ConcurrentMergeScheduler) iwc.getMergeScheduler();
     assertEquals("ms.maxMergeCount", 987, ms.getMaxMergeCount());
     assertEquals("ms.maxThreadCount", 42, ms.getMaxThreadCount());
-    assertTrue("ms.isAutoIOThrottle", ms.getAutoIOThrottle());
+    assertFalse("ms.isAutoIOThrottle", ms.getAutoIOThrottle());

Review Comment:
   note-to-self bookmark: would like to understand more about this change here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2301521366


##########
gradle/libs.versions.toml:
##########
@@ -37,8 +37,8 @@ apache-httpcomponents-httpcore = "4.4.16"
 apache-httpcomponents-httpmime = "4.5.14"
 apache-kafka = "3.9.0"
 apache-log4j = "2.21.0"
-apache-lucene = "9.12.2"
-apache-opennlp = "1.9.4"
+apache-lucene = "10.2.1"

Review Comment:
   https://lucene.apache.org/core/10_2_2/changes/Changes.html
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2288462023


##########
solr/core/src/test-files/solr/collection1/conf/schema.xml:
##########
@@ -471,12 +471,13 @@
     </analyzer>
   </fieldType>
   <!-- 
-    Example of using PathHierarchyTokenizerFactory at query time, so
-    queries for paths match documents at that path, or in ancestor paths
+    Example of using PathHierarchyTokenizerFactory for ancestor queries.
+    Since Lucene 10 produces sequential tokens, we need to store paths at index time
+    to match against sequential query tokens properly.
   -->
   <fieldType name="ancestor_path" class="solr.TextField">
     <analyzer type="index">
-      <tokenizer class="solr.KeywordTokenizerFactory"/>
+      <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/"/>
     </analyzer>
     <analyzer type="query">
       <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/"/>

Review Comment:
   minor/subjective: could combine the two `analyzer` elements since they are now identical



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2050646974


##########
solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java:
##########
@@ -66,7 +65,7 @@ public void init(NamedList<?> args) {
   protected Directory create(String path, LockFactory lockFactory, DirContext dirContext)
       throws IOException {
     MMapDirectory mapDirectory = new MMapDirectory(Path.of(path), lockFactory, maxChunk);
-    mapDirectory.setPreload(preload);
+    mapDirectory.setPreload((s, ioContext) -> preload);

Review Comment:
   [INFO] [Lucene #1192](https://github.com/apache/lucene/pull/11929) - old method deprecated but not removed.



##########
solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java:
##########
@@ -380,7 +380,7 @@ private BooleanQuery getBoostedQuery(Query mltquery) {
         BooleanQuery.Builder newQ = new BooleanQuery.Builder();
         newQ.setMinimumNumberShouldMatch(boostedQuery.getMinimumNumberShouldMatch());
         for (BooleanClause clause : boostedQuery) {
-          Query q = clause.getQuery();
+          Query q = clause.query();

Review Comment:
   [INFO] The diff in this file is all due to a larger push in Lucene to use immutable Java "record"s instead of classes where possible, which changes the name of some getters. See [Lucene #13207](https://github.com/apache/lucene/issues/13207) for more details



##########
solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java:
##########
@@ -459,7 +460,7 @@ protected void addClause(List<BooleanClause> clauses, int conj, int mods, Query
     if (clauses.size() > 0 && conj == CONJ_AND) {
       BooleanClause c = clauses.get(clauses.size() - 1);
       if (!c.isProhibited())
-        clauses.set(clauses.size() - 1, new BooleanClause(c.getQuery(), BooleanClause.Occur.MUST));
+        clauses.set(clauses.size() - 1, new BooleanClause(c.query(), BooleanClause.Occur.MUST));

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see https://github.com/apache/lucene/issues/13207 for more details.



##########
solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java:
##########
@@ -101,7 +102,7 @@ public static LeafReader wrap(IndexReader reader) throws IOException {
     } else {
       Version minVersion = Version.LATEST;
       for (LeafReaderContext leafReaderContext : reader.leaves()) {
-        Version leafVersion = leafReaderContext.reader().getMetaData().getMinVersion();
+        Version leafVersion = leafReaderContext.reader().getMetaData().minVersion();

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see https://github.com/apache/lucene/issues/13207 for more details.



##########
solr/core/src/java/org/apache/solr/schema/EnumField.java:
##########
@@ -106,7 +107,7 @@ protected Query getSpecializedRangeQuery(
               min == null ? null : minValue,
               max == null ? null : maxValue,
               minInclusive,
-              maxInclusive);
+              maxInclusive, MultiTermQuery.CONSTANT_SCORE_REWRITE);

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removed the `setRewriteMethod` setter in favor of a ctor arg in MultiTermQuery, which changes the invocation here. 



##########
solr/core/src/java/org/apache/solr/legacy/LegacyNumericRangeQuery.java:
##########
@@ -187,8 +187,9 @@ private LegacyNumericRangeQuery(
       T min,
       T max,
       final boolean minInclusive,
-      final boolean maxInclusive) {
-    super(field, MultiTermQuery.CONSTANT_SCORE_REWRITE);
+      final boolean maxInclusive,
+      MultiTermQuery.RewriteMethod rewriteMethod) {
+    super(field, rewriteMethod);

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removes the `MultiTermQuery.setRewriteMethod` setter in favor of a ctor arg to ensure that `MultiTermQuery` is immutable, which triggers most of the ctor and factory-method signature changes in this file. 



##########
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java:
##########
@@ -1562,7 +1547,7 @@ protected void delegateCollect() throws IOException {
       // (our supper class may have set the "real" scorer on our leafDelegate
       // and it may have an incorrect docID)
       leafDelegate.setScorer(currentGroupState);
-      leafDelegate.collect(currentGroupState.docID());
+      leafDelegate.collect(currentGroupState.docId);

Review Comment:
   [Q] Is this strictly related to the Lucene upgrade in some way I'm missing?  All of the code involved seems to be Solr-side...



##########
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java:
##########
@@ -522,11 +511,12 @@ private static class ReaderWrapper extends FilterLeafReader {
               new FieldInfo(
                   fieldInfo.name,
                   fieldInfo.number,
-                  fieldInfo.hasVectors(),
+                  fieldInfo.hasTermVectors(),
                   fieldInfo.hasNorms(),
                   fieldInfo.hasPayloads(),
                   fieldInfo.getIndexOptions(),
                   DocValuesType.NONE,
+                  DocValuesSkipIndexType.NONE,

Review Comment:
   [INFO] https://github.com/apache/lucene/pull/13449 adds an optional "skip-list" capability to the docValues format, to allow skipping over sections of the DocValues data structure in sparse index use cases.
   
   This seems like a thing we should support for performance benefits, but not having it shouldn't impact correctness in terms of this PR.



##########
solr/core/src/java/org/apache/solr/core/SolrConfig.java:
##########
@@ -269,12 +269,12 @@ private SolrConfig(SolrResourceLoader loader, String name, Properties substituta
       indexConfig = new SolrIndexConfig(get("indexConfig"), null);
 
       booleanQueryMaxClauseCount =
-          get("query").get("maxBooleanClauses").intVal(BooleanQuery.getMaxClauseCount());
+          get("query").get("maxBooleanClauses").intVal(IndexSearcher.getMaxClauseCount());

Review Comment:
   [INFO] [LUCENE-8811](https://issues.apache.org/jira/browse/LUCENE-8811) moved this setting to IndexSearcher, since it's theoretically applicable to more than just BooleanQuery instances.



##########
solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java:
##########
@@ -778,13 +761,13 @@ private DocSlice collectorToDocSlice(
             docs[i] = scoreDoc.doc;
             scores[i] = scoreDoc.score;
           }
-          assert topDocs.totalHits.relation == TotalHits.Relation.EQUAL_TO;
+          assert topDocs.totalHits.relation() == TotalHits.Relation.EQUAL_TO;

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see [Lucene #13207](https://github.com/apache/lucene/issues/13207) for more details.



##########
solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java:
##########
@@ -97,7 +97,7 @@ public void init(NamedList<?> args) {
       log.debug("Using default compressionMode: {}", compressionMode);
     }
     codec =
-        new Lucene912Codec(compressionMode) {
+        new Lucene101Codec(compressionMode) {

Review Comment:
   [INFO] Most `Format`s comprising this codec are the same as 9.x, with the notable exception of `Lucene101PostingsFormat` for the posting-list.  (See [Lucene #13968](https://github.com/apache/lucene/pull/13968))



##########
solr/core/src/java/org/apache/solr/handler/admin/api/GetSegmentData.java:
##########
@@ -317,10 +317,10 @@ private GetSegmentDataResponse.SingleSegmentData getSegmentInfo(
     if (seg != null) {
       LeafMetaData metaData = seg.getMetaData();
       if (metaData != null) {
-        segmentInfo.createdVersionMajor = metaData.getCreatedVersionMajor();
-        segmentInfo.minVersion = metaData.getMinVersion().toString();
-        if (metaData.getSort() != null) {
-          segmentInfo.sort = metaData.getSort().toString();
+        segmentInfo.createdVersionMajor = metaData.createdVersionMajor();

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see [Lucene #13207](https://github.com/apache/lucene/issues/13207) for more details.



##########
solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java:
##########
@@ -764,7 +764,7 @@ private void addDebugInfo(ResponseBuilder rb, Elevation elevation) {
       // Extract the elevated terms into a list
       match = new ArrayList<>(elevation.includeQuery.clauses().size());
       for (BooleanClause clause : elevation.includeQuery.clauses()) {
-        TermQuery tq = (TermQuery) clause.getQuery();
+        TermQuery tq = (TermQuery) clause.query();

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see https://github.com/apache/lucene/issues/13207 for more details.



##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -330,7 +330,7 @@ public void process(ResponseBuilder rb) throws IOException {
           if (rb.getFilters() != null) {
             for (Query raw : rb.getFilters()) {
               raw = makeQueryable(raw);
-              Query q = raw.rewrite(searcherInfo.getSearcher().getIndexReader());
+              Query q = raw.rewrite(searcherInfo.getSearcher());

Review Comment:
   [INFO] [Lucene #11838](https://github.com/apache/lucene/issues/11838) changes the `rewrite()` API to take an IndexSearcher, so that the searcher's executor can be used to do rewriting in parallel if desired.



##########
solr/core/src/java/org/apache/solr/handler/BlobHandler.java:
##########
@@ -142,7 +142,7 @@ public void handleRequestBody(final SolrQueryRequest req, SolrQueryResponse rsp)
                     new Sort(new SortField("version", SortField.Type.LONG, true)));
 
         long version = 0;
-        if (docs.totalHits.value > 0) {
+        if (docs.totalHits.value() > 0) {

Review Comment:
   [INFO] `value()` becomes a method call by virtue of a larger push in Lucene to use immutable Java "record"s instead of classes where possible.  See [Lucene #13207](https://github.com/apache/lucene/issues/13207) for more details



##########
solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java:
##########
@@ -825,9 +808,9 @@ protected final Collector getCollector() throws IOException {
       if (limit == 0) {
         collector = new TotalHitCountCollector();
       } else if (sort == null) {
-        collector = TopScoreDocCollector.create(limit, Integer.MAX_VALUE);
+        collector = new TopScoreDocCollectorManager(limit, Integer.MAX_VALUE).newCollector();

Review Comment:
   [INFO] [LUCENE-6294](https://issues.apache.org/jira/browse/LUCENE-6294) introduced the concept of a "CollectorManager" in support of parallelizing hit collection.  But certain IndexSearcher methods (i.e. those that took an explicit `Collector` like `search(Query, Collector)`) didn't take advantage of this.  [LUCENE-10002](https://issues.apache.org/jira/browse/LUCENE-10002) deprecated these Collector-based `search()` methods to better steer users towards parallel collection, and added TopScoreDocCollectorManager and TopFieldCollectorManager in the process.



##########
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
##########
@@ -540,7 +540,12 @@ protected int compare(int i, int j) {
             }
 
             doc -= currentLeaf.docBase; // adjust for what segment this is in
-            leafComparator.setScorer(new ScoreAndDoc(doc, score));
+            leafComparator.setScorer(new Scorable() {

Review Comment:
   [Q] This (and the deletion of ScoreAndDoc below) doesn't seem related to the Lucene upgrade afaict.  Additionally, ScoreAndDoc's comments indicate that it can be removed after SOLR-5595 finishes - but SOLR-5595 is still open. 
    
   Am I missing something about these changes?



##########
solr/core/src/java/org/apache/solr/parser/QueryParser.java:
##########
@@ -243,8 +243,8 @@ protected Query newFieldQuery(Analyzer analyzer, String field, String queryText,
         }
       }
     }
-if (clauses.size() == 1 && clauses.get(0).getOccur() == BooleanClause.Occur.SHOULD) {
-      Query firstQuery = clauses.get(0).getQuery();
+if (clauses.size() == 1 && clauses.get(0).occur() == BooleanClause.Occur.SHOULD) {

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see https://github.com/apache/lucene/issues/13207 for more details.



##########
solr/core/src/java/org/apache/solr/request/SimpleFacets.java:
##########
@@ -819,11 +819,11 @@ public NamedList<Integer> getGroupedCounts(
         result.getFacetEntries(offset, limit < 0 ? Integer.MAX_VALUE : limit);
     for (GroupFacetCollector.FacetEntry facetEntry : scopedEntries) {
       // :TODO:can we filter earlier than this to make it more efficient?
-      if (termFilter != null && !termFilter.test(facetEntry.getValue())) {
+      if (termFilter != null && !termFilter.test(facetEntry.value())) {

Review Comment:
   [INFO] Method names change due to class->record movement in Lucene; see https://github.com/apache/lucene/issues/13207 for more details.



##########
solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java:
##########
@@ -112,14 +113,20 @@ public static LeafReader wrap(IndexReader reader) throws IOException {
       LeafMetaData leafMetaData = reader.leaves().get(0).reader().getMetaData();
       metaData =
           new LeafMetaData(
-              leafMetaData.getCreatedVersionMajor(),
+              leafMetaData.createdVersionMajor(),
               minVersion,
-              leafMetaData.getSort(),
+              leafMetaData.sort(),
               leafMetaData.hasBlocks());
     }
     fieldInfos = FieldInfos.getMergedFieldInfos(in);
   }
 
+  @Override
+  public DocValuesSkipper getDocValuesSkipper(String field) throws IOException {

Review Comment:
   [INFO] https://github.com/apache/lucene/pull/13449 adds an optional "skip-list" capability to the docValues format, to allow skipping over sections of the DocValues data structure in sparse index use cases.
   
   This seems like a thing we _should_ support for performance benefits, but not having it shouldn't impact correctness in terms of this PR.
   
   (In general I worry that it's easy to lose track of these sort of things where gets some speed up that requires a bit of work on our part ot realize.  Maybe we should have a JIRA tag or umbrella for these?)



##########
solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java:
##########
@@ -598,10 +599,8 @@ protected Query newPrefixQuery(Term prefix) {
    * @return new RegexpQuery instance
    */
   protected Query newRegexpQuery(Term regexp) {
-    RegexpQuery query = new RegexpQuery(regexp);
     SchemaField sf = schema.getField(regexp.field());
-    query.setRewriteMethod(sf.getType().getRewriteMethod(parser, sf));
-    return query;
+    return new RegexpQuery(regexp, RegExp.ALL, 0, RegexpQuery.DEFAULT_PROVIDER, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT, sf.getType().getRewriteMethod(parser, sf));

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removes the MultiTermQuery.setRewriteMethod setter in favor of a ctor arg to ensure that MultiTermQuery is immutable, triggering this change to provide the rewriteMethod at ctor-time.  All other new args match the defaults previously used by the `RegexpQuery(regexp)` ctor.



##########
solr/core/src/java/org/apache/solr/query/SolrRangeQuery.java:
##########
@@ -157,7 +144,7 @@ private String endpoint(BytesRef ref) {
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   [INFO] https://github.com/apache/lucene/issues/11838 changes the rewrite() API to take an IndexSearcher, so that the searcher's executor can be used to do rewriting in parallel if desired.



##########
solr/core/src/java/org/apache/solr/request/IntervalFacets.java:
##########
@@ -371,7 +371,8 @@ private void accumIntervalsMulti(SortedSetDocValues ssdv, DocIdSetIterator disi)
       if (doc == ssdv.docID()) {
         long currOrd;
         int currentInterval = 0;
-        while ((currOrd = ssdv.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+        for (int o=0; o<ssdv.docValueCount(); o++) {

Review Comment:
   [INFO] [LUCENE-10603](https://issues.apache.org/jira/browse/LUCENE-10603) removed `SortedSetDocValues.NO_MORE_ORDS` to steer users towards using the new-ish `docValueCount()` method of iteration use-cases. 



##########
solr/core/src/java/org/apache/solr/query/FilterQuery.java:
##########
@@ -104,8 +104,8 @@ public void visit(QueryVisitor visitor) {
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
-    Query newQ = q.rewrite(reader);
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   [INFO] https://github.com/apache/lucene/issues/11838 changes the rewrite() API to take an IndexSearcher, so that the searcher's executor can be used to do rewriting in parallel if desired.



##########
solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java:
##########
@@ -362,8 +362,7 @@ public ValueSource getValueSource(SchemaField field, QParser parser) {
 
   @Override
   protected Query getSpecializedExistenceQuery(QParser parser, SchemaField field) {
-    PrefixQuery query = new PrefixQuery(new Term(field.getName(), ""));
-    query.setRewriteMethod(field.getType().getRewriteMethod(parser, field));
+    PrefixQuery query = new PrefixQuery(new Term(field.getName(), ""), field.getType().getRewriteMethod(parser, field));

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removed the `setRewriteMethod` setter in favor of a ctor arg in MultiTermQuery, which changes the invocation here. 



##########
solr/core/src/java/org/apache/solr/request/DocValuesStats.java:
##########
@@ -222,7 +222,9 @@ static int accumMulti(
       }
       if (doc == si.docID()) {
         long ord;
-        while ((ord = si.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+        //while ((ord = si.nextOrd()) != SortedSetDocValues.NO_MORE_DOCS) {

Review Comment:
   [INFO] [LUCENE-10603](https://issues.apache.org/jira/browse/LUCENE-10603) removed `SortedSetDocValues.NO_MORE_ORDS` to steer users towards using the new-ish `docValueCount()` method of iteration use-cases. 



##########
solr/core/src/java/org/apache/solr/schema/FieldType.java:
##########
@@ -1033,10 +1030,10 @@ protected Query getSpecializedRangeQuery(
    */
   public Query getExistenceQuery(QParser parser, SchemaField field) {
     if (field.hasDocValues()) {
-      return new DocValuesFieldExistsQuery(field.getName());
+      return new FieldExistsQuery(field.getName());

Review Comment:
   [INFO] LUCENE-10436 created a new `FieldExistsQuery` that combines various data-structure specific "exists" implementations (e.g. DocValuesFieldExistsQuery, NormsFieldExistsQuery and KnnVectorFieldExistsQuery).



##########
solr/core/src/java/org/apache/solr/schema/CurrencyFieldType.java:
##########
@@ -387,7 +387,7 @@ private Query getRangeQueryInternal(
         (p1 != null) ? p1.getCurrencyCode() : (p2 != null) ? p2.getCurrencyCode() : defaultCurrency;
 
     // ValueSourceRangeFilter doesn't check exists(), so we have to
-    final Query docsWithValues = new DocValuesFieldExistsQuery(getAmountField(field).getName());
+    final Query docsWithValues = new FieldExistsQuery(getAmountField(field).getName());

Review Comment:
   [INFO] LUCENE-10436 created a new `FieldExistsQuery` that combines various data-structure specific "exists" implementations (e.g. DocValuesFieldExistsQuery, NormsFieldExistsQuery and KnnVectorFieldExistsQuery).



##########
solr/core/src/java/org/apache/solr/schema/SchemaField.java:
##########
@@ -531,6 +527,11 @@ public DocValuesType docValuesType() {
     return DocValuesType.NONE;
   }
 
+  @Override

Review Comment:
   [INFO] https://github.com/apache/lucene/pull/13449 adds an optional "skip-list" capability to the docValues format, to allow skipping over sections of the DocValues data structure in sparse index use cases.
   
   This seems like a thing we should support for performance benefits, but not having it shouldn't impact correctness in terms of this PR.



##########
solr/core/src/java/org/apache/solr/schema/FieldType.java:
##########
@@ -483,8 +482,7 @@ public Query getPrefixQuery(QParser parser, SchemaField sf, String termStr) {
     if (termStr != null && termStr.isEmpty()) {
       return getExistenceQuery(parser, sf);
     }
-    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr));
-    query.setRewriteMethod(sf.getType().getRewriteMethod(parser, sf));
+    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr), sf.getType().getRewriteMethod(parser, sf));

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removed the `setRewriteMethod` setter in favor of a ctor arg in MultiTermQuery, which changes the invocation here. 



##########
solr/core/src/java/org/apache/solr/schema/TrieField.java:
##########
@@ -352,7 +353,7 @@ protected Query getSpecializedRangeQuery(
                 min == null ? null : parseIntFromUser(field.getName(), min),
                 max == null ? null : parseIntFromUser(field.getName(), max),
                 minInclusive,
-                maxInclusive);
+                maxInclusive, MultiTermQuery.CONSTANT_SCORE_REWRITE);

Review Comment:
   [INFO] [LUCENE-10431](https://issues.apache.org/jira/browse/LUCENE-10431) removed the setRewriteMethod setter in favor of a ctor arg in MultiTermQuery, which changes the invocation here and elsewhere in this file.



##########
solr/core/src/java/org/apache/solr/search/AbstractReRankQuery.java:
##########
@@ -97,12 +97,12 @@ public TopDocsCollector<? extends ScoreDoc> getTopDocsCollector(
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
-    Query q = mainQuery.rewrite(reader);
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   [INFO] https://github.com/apache/lucene/issues/11838 changed the `rewrite()` API to take in an IndexSearcher to enable rewriting to occur in parallel if desired.



##########
solr/core/src/java/org/apache/solr/core/backup/repository/BackupRepository.java:
##########
@@ -216,7 +216,7 @@ default void copyIndexFileFrom(
       Directory sourceDir, String sourceFileName, Directory destDir, String destFileName)
       throws IOException {
     boolean success = false;
-    try (ChecksumIndexInput is = sourceDir.openChecksumInput(sourceFileName, IOContext.READONCE);
+    try (ChecksumIndexInput is = sourceDir.openChecksumInput(sourceFileName);

Review Comment:
   [INFO] Motivation/context in [Lucene #11933](https://github.com/apache/lucene/issues/11933); seems like "READONCE" was the only IOContext that ever made sense here, so it was removed to week out redundancy.



##########
solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java:
##########
@@ -442,11 +442,11 @@ private Version parseConfiguredVersion(String configuredVersion, String pluginCl
             ? SolrConfig.parseLuceneVersionString(configuredVersion)
             : schema.getDefaultLuceneMatchVersion();
 
-    if (!version.onOrAfter(Version.LUCENE_8_0_0)) {
+    if (!version.onOrAfter(Version.LUCENE_9_0_0)) {
       log.warn(
           "{} is using deprecated {}"
-              + " emulation. You should at some point declare and reindex to at least 8.0, because "
-              + "7.x emulation is deprecated and will be removed in 9.0",
+              + " emulation. You should at some point declare and reindex to at least 9.0, because "

Review Comment:
   [Q] This code is going to 'main'...does it make sense to be talking about things that'll be removed prior to 10.0 actually going out the door?  I'm either confused, or our versions have gotten a bit jumbled up in this log message at some point... 



##########
solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java:
##########
@@ -128,7 +128,8 @@ protected Query newWildcardQuery(org.apache.lucene.index.Term t) {
               try {
                 org.apache.lucene.search.Query wildcardQuery =
                     reverseAwareParser.getWildcardQuery(t.field(), t.text());
-                setRewriteMethod(wildcardQuery);
+                //TBD . We may not need this as the constructor is invoked with the rewite method

Review Comment:
   [Q] Should this be a nocommit so it doesn't get lost?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165198787

   Thanks so much Ishan & others!  I mean that super sincerely... 
   
   But I've got other say, it's premature to merge a PR without either first seeking and getting another approval or to state your intention to merge in 48 hours.  This isn't a triival PR (of course).  I don't want other committers (esp. new ones) or contributors to think this is normal.  It's not.  The same thing happened with the multiThreaded PR, which didn't turn out well, as you know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2291597659


##########
solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java:
##########
@@ -452,7 +452,8 @@ private static void simpleBackupCheck(
           Files.exists(backup.resolve(expectedSegmentsFileName)));
     }
     try (Directory dir = FSDirectory.open(backup)) {
-      TestUtil.checkIndex(dir, true, true, true, null);
+      // Lucene 10 changed CheckIndex levels from 0-3 to 1-3, so we use 1 (minimum level)
+      TestUtil.checkIndex(dir, 1, true, true, null);

Review Comment:
   minor: `CheckIndex.Level.*` enum could be used here -- I can include that in #3495



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2288483895


##########
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
##########
@@ -1787,6 +1794,11 @@ private void doProcessUngroupedSearch(ResponseBuilder rb, QueryCommand cmd) thro
     }
     rb.setResult(result);
 
+    QueryLimits queryLimits = QueryLimits.getCurrentLimits();
+    if (queryLimits.maybeExitWithPartialResults("QueryComponent")) {
+      return;
+    }
+

Review Comment:
   note-to-self bookmark: would like to understand more about this change here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1928384222


##########
solr/core/src/java/org/apache/solr/core/backup/repository/BackupRepository.java:
##########
@@ -216,7 +216,7 @@ default void copyIndexFileFrom(
       Directory sourceDir, String sourceFileName, Directory destDir, String destFileName)
       throws IOException {
     boolean success = false;
-    try (ChecksumIndexInput is = sourceDir.openChecksumInput(sourceFileName, IOContext.READONCE);
+    try (ChecksumIndexInput is = sourceDir.openChecksumInput(sourceFileName);

Review Comment:
   links:
   * https://github.com/apache/lucene/blob/releases/lucene/9.12.1/lucene/core/src/java/org/apache/lucene/store/Directory.java#L155-L157
   * https://github.com/apache/lucene/blob/releases/lucene/10.1.0/lucene/core/src/java/org/apache/lucene/store/Directory.java#L155-L157



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2607539742

   I dealt with the removal of SortedSetDocValues.NO_MORE_ORDS [0] inaccurately in the PR. Will fix now.
   
   [0] - https://github.com/apache/lucene/pull/969


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1928398006


##########
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
##########
@@ -1755,7 +1755,6 @@ protected static class ScoreAndDoc extends Scorable {
       this.score = score;
     }
 
-    @Override
     public int docID() {
       return docid;
     }

Review Comment:
   Maybe this can be removed, haven't tried it yet though.
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2050996506


##########
solr/core/src/test/org/apache/solr/legacy/TestMultiValuedNumericRangeQuery.java:
##########
@@ -79,16 +76,16 @@ public void testMultiValuedNRQ() throws Exception {
               "asc", format.format(lower), format.format(upper), true, true);
       LegacyNumericRangeQuery<Integer> tq =
           LegacyNumericRangeQuery.newIntRange("trie", lower, upper, true, true);
-      TopScoreDocCollector trCollector = TopScoreDocCollector.create(1, Integer.MAX_VALUE);
-      TopScoreDocCollector nrCollector = TopScoreDocCollector.create(1, Integer.MAX_VALUE);
+      TopScoreDocCollector trCollector = new TopScoreDocCollectorManager(1, Integer.MAX_VALUE).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
##########
@@ -183,12 +175,12 @@ private void testRange(int precisionStep) throws Exception {
       ScoreDoc[] sd = topDocs.scoreDocs;
       assertNotNull(sd);
       assertEquals("Score doc count" + type, count, sd.length);
-      Document doc = searcher.doc(sd[0].doc);
+      Document doc = searcher.storedFields().document(sd[0].doc);

Review Comment:
   ditto, re: "IndexSearcher.doc removal/replacement" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050986335)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
##########
@@ -160,20 +153,19 @@ private void testRange(int precisionStep) throws Exception {
     String field = "field" + precisionStep;
     int count = 3000;
     int lower = (distance * 3 / 2) + startOffset, upper = lower + count * distance + (distance / 3);
-    LegacyNumericRangeQuery<Integer> q =
-        LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower, upper, true, true);
+    LegacyNumericRangeQuery<Integer> q;
     for (byte i = 0; i < 2; i++) {
       TopFieldCollector collector =
-          TopFieldCollector.create(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE);
+          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245)



##########
solr/core/src/test/org/apache/solr/handler/tagger/TaggerTestCase.java:
##########
@@ -139,11 +140,12 @@ protected TestTag[] pullTagsFromResponse(SolrQueryRequest req, SolrQueryResponse
     NamedList<?> rspValues = rsp.getValues();
     Map<String, String> matchingNames = new HashMap<>();
     SolrIndexSearcher searcher = req.getSearcher();
+    SolrDocumentFetcher docFetcher = searcher.getDocFetcher();
     DocList docList = (DocList) rspValues.get("response");
     DocIterator iter = docList.iterator();
     while (iter.hasNext()) {
       int docId = iter.next();
-      Document doc = searcher.doc(docId);
+      Document doc = docFetcher.doc(docId);

Review Comment:
   ditto, re: "IndexSearcher.doc removal/replacement" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050986335)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
##########
@@ -172,20 +165,19 @@ private void testRange(int precisionStep) throws Exception {
     int count = 3000;
     long lower = (distance * 3 / 2) + startOffset,
         upper = lower + count * distance + (distance / 3);
-    LegacyNumericRangeQuery<Long> q =
-        LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower, upper, true, true);
+    LegacyNumericRangeQuery<Long> q;
     for (byte i = 0; i < 2; i++) {
       TopFieldCollector collector =
-          TopFieldCollector.create(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE);
+          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery32.java:
##########
@@ -160,20 +153,19 @@ private void testRange(int precisionStep) throws Exception {
     String field = "field" + precisionStep;
     int count = 3000;
     int lower = (distance * 3 / 2) + startOffset, upper = lower + count * distance + (distance / 3);
-    LegacyNumericRangeQuery<Integer> q =
-        LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower, upper, true, true);
+    LegacyNumericRangeQuery<Integer> q;
     for (byte i = 0; i < 2; i++) {
       TopFieldCollector collector =
-          TopFieldCollector.create(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE);
+          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE).newCollector();
       String type;
       switch (i) {
         case 0:
           type = " (constant score filter rewrite)";
-          q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE);
+          q = LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower, upper, true, true, MultiTermQuery.CONSTANT_SCORE_REWRITE);

Review Comment:
   ditto, re: "RewriteMethod in ctor"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050746215)



##########
solr/core/src/test/org/apache/solr/search/LargeFieldTest.java:
##########
@@ -96,7 +96,7 @@ public void test() throws Exception {
     assertQ(req("q", "101", "df", ID_FLD, "fl", ID_FLD)); // eager load ID_FLD; rest are lazy
 
     // fetch the document; we know it will be from the documentCache, docId 0
-    final Document d = h.getCore().withSearcher(searcher -> searcher.doc(0));
+    final Document d = h.getCore().withSearcher(searcher -> searcher.storedFields().document(0));

Review Comment:
   ditto, re: "IndexSearcher.doc removal/replacement" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050986335)



##########
solr/core/src/test/org/apache/solr/search/TestCancellableCollector.java:
##########
@@ -96,7 +88,7 @@ public void tearDown() throws Exception {
 
   private CancellableCollector buildCancellableCollector(
       final int numHits, boolean delayStart, boolean delayCollection) {
-    TopScoreDocCollector topScoreDocCollector = TopScoreDocCollector.create(numHits, null, 1);
+    TopScoreDocCollector topScoreDocCollector = new TopScoreDocCollectorManager(numHits, null, 1).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
##########
@@ -172,20 +165,19 @@ private void testRange(int precisionStep) throws Exception {
     int count = 3000;
     long lower = (distance * 3 / 2) + startOffset,
         upper = lower + count * distance + (distance / 3);
-    LegacyNumericRangeQuery<Long> q =
-        LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower, upper, true, true);
+    LegacyNumericRangeQuery<Long> q;
     for (byte i = 0; i < 2; i++) {
       TopFieldCollector collector =
-          TopFieldCollector.create(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE);
+          new TopFieldCollectorManager(Sort.INDEXORDER, noDocs, Integer.MAX_VALUE).newCollector();
       String type;
       switch (i) {
         case 0:
           type = " (constant score filter rewrite)";
-          q.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_REWRITE);
+          q = LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower, upper, true, true, MultiTermQuery.CONSTANT_SCORE_REWRITE);

Review Comment:
   ditto, re: "RewriteMethod in ctor"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050746215)



##########
solr/core/src/test/org/apache/solr/search/TestCancellableCollector.java:
##########
@@ -114,7 +106,7 @@ private void executeSearchTest(
     TopScoreDocCollector topScoreDocCollector =
         (TopScoreDocCollector) internalCancellableCollector.getInternalCollector();
 
-    assertEquals(topDocs.totalHits.value, topScoreDocCollector.getTotalHits());
+    assertEquals(topDocs.totalHits.value(), topScoreDocCollector.getTotalHits());

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/search/TestDocSet.java:
##########
@@ -363,6 +339,11 @@ public NumericDocValues getNormValues(String field) {
         return null;
       }
 
+      @Override

Review Comment:
   ditto, re: "sparse index skip list capability"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050785064)



##########
solr/core/src/test/org/apache/solr/schema/MyCrazyCustomField.java:
##########
@@ -51,8 +51,7 @@ public Query getPrefixQuery(QParser parser, SchemaField sf, String termStr) {
       termStr = "foo";
     }
 
-    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr));
-    query.setRewriteMethod(sf.getType().getRewriteMethod(parser, sf));
+    PrefixQuery query = new PrefixQuery(new Term(sf.getName(), termStr), sf.getType().getRewriteMethod(parser, sf));

Review Comment:
   ditto, re: "RewriteMethod in ctor"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050746215)



##########
solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java:
##########
@@ -125,7 +115,7 @@ public void testNullDocIdSet() throws Exception {
 
     // First verify the document is searchable.
     IndexSearcher searcher = newSearcher(reader);
-    assertEquals(1, searcher.search(new MatchAllDocsQuery(), 10).totalHits.value);
+    assertEquals(1, searcher.search(new MatchAllDocsQuery(), 10).totalHits.value());

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/legacy/TestNumericRangeQuery64.java:
##########
@@ -195,12 +187,12 @@ private void testRange(int precisionStep) throws Exception {
       ScoreDoc[] sd = topDocs.scoreDocs;
       assertNotNull(sd);
       assertEquals("Score doc count" + type, count, sd.length);
-      Document doc = searcher.doc(sd[0].doc);
+      Document doc = searcher.storedFields().document(sd[0].doc);

Review Comment:
   ditto, re: "IndexSearcher.doc removal/replacement" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050986335)



##########
solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java:
##########
@@ -96,14 +96,13 @@ public void testDocValues() throws IOException {
         assertEquals(0, dv.nextDoc());
         assertEquals(0, dv.nextOrd());
         assertEquals(1, dv.nextOrd());
-        assertEquals(SortedSetDocValues.NO_MORE_ORDS, dv.nextOrd());
+        assertEquals(2, dv.docValueCount());

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/test/org/apache/solr/search/TestMinHashQParser.java:
##########
@@ -424,7 +424,7 @@ public void testBandsWrap() throws SyntaxError {
     assertEquals(4, bq.clauses().size());
     for (BooleanClause clause : bq.clauses()) {
       assertEquals(
-          3, ((BooleanQuery) ((ConstantScoreQuery) clause.getQuery()).getQuery()).clauses().size());
+          3, ((BooleanQuery) ((ConstantScoreQuery) clause.query()).getQuery()).clauses().size());

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java:
##########
@@ -3158,7 +3158,7 @@ private boolean containsClause(FuzzyQuery query, String field, String value) {
   private boolean containsClause(
       BooleanQuery query, String field, String value, int boost, boolean fuzzy) {
     for (BooleanClause clause : query) {
-      if (containsClause(clause.getQuery(), field, value, boost, fuzzy)) {
+      if (containsClause(clause.query(), field, value, boost, fuzzy)) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/search/TestFilteredDocIdSet.java:
##########
@@ -166,7 +156,7 @@ public Explanation explain(LeafReaderContext context, int doc) {
               }
 
               @Override
-              public Scorer scorer(LeafReaderContext leafReaderContext) {
+              public ScorerSupplier scorerSupplier(LeafReaderContext leafReaderContext) {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/test/org/apache/solr/search/TestSolrCoreParser.java:
##########
@@ -123,8 +123,8 @@ public void testHandyQuery() throws ParserException {
     assertTrue(query instanceof BooleanQuery);
     final BooleanQuery bq = (BooleanQuery) query;
     assertEquals(2, bq.clauses().size());
-    assertTrue(bq.clauses().get(0).getQuery() instanceof MatchAllDocsQuery);
-    assertTrue(bq.clauses().get(1).getQuery() instanceof MatchNoDocsQuery);
+    assertTrue(bq.clauses().get(0).query() instanceof MatchAllDocsQuery);

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/search/TestMaxScoreQueryParser.java:
##########
@@ -88,10 +88,10 @@ public void testPureMax() {
     q = parse("foo bar");
     clauses = clauses(q);
     assertEquals(1, clauses.length);
-    assertTrue(clauses[0].getQuery() instanceof DisjunctionMaxQuery);
+    assertTrue(clauses[0].query() instanceof DisjunctionMaxQuery);

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2288820190


##########
solr/core/src/test/org/apache/solr/TestHighlightDedupGrouping.java:
##########
@@ -36,10 +35,7 @@ public class TestHighlightDedupGrouping extends BaseDistributedSearchTestCase {
   private static final String shard_i1 = "shard_i1";
 
   @AfterClass
-  public static void afterClass() throws Exception {
-    TimeLimitingCollector.getGlobalTimerThread().stopTimer();
-    TimeLimitingCollector.getGlobalTimerThread().join();
-  }
+  public static void afterClass() throws Exception {}

Review Comment:
   minor: method can be removed if it's now a no-op



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165249702

   >     The same thing happened with the multiThreaded PR, which didn't turn out well, as you know.
   
   I've opened up an issue to fix it: https://issues.apache.org/jira/browse/SOLR-17841
   Lets take the blame game there, or maybe fix it there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "asf-gitbox-commits (via GitHub)" <gi...@apache.org>.
asf-gitbox-commits merged PR #3053:
URL: https://github.com/apache/solr/pull/3053


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2050966911


##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java:
##########
@@ -233,7 +233,7 @@ static void fillResultIds(ResponseBuilder rb) {
     int i = 0;
     for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
       for (GroupDocs<BytesRef> group : topGroups.groups) {
-        for (ScoreDoc scoreDoc : group.scoreDocs) {
+        for (ScoreDoc scoreDoc : group.scoreDocs()) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java:
##########
@@ -201,7 +201,7 @@ public void postCollect(IndexSearcher searcher) throws IOException {
     }
     if (needScores) {
       for (GroupDocs<?> group : topGroups.groups) {
-        TopFieldCollector.populateScores(group.scoreDocs, searcher, query);
+        TopFieldCollector.populateScores(group.scoreDocs(), searcher, query);

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java:
##########
@@ -222,24 +222,24 @@ protected NamedList<Object> serializeTopGroups(TopGroups<BytesRef> data, SchemaF
     SchemaField uniqueField = schema.getUniqueKeyField();
     for (GroupDocs<BytesRef> searchGroup : data.groups) {
       NamedList<Object> groupResult = new NamedList<>();
-      assert searchGroup.totalHits.relation == TotalHits.Relation.EQUAL_TO;
-      groupResult.add("totalHits", searchGroup.totalHits.value);
-      if (!Float.isNaN(searchGroup.maxScore)) {
-        groupResult.add("maxScore", searchGroup.maxScore);
+      assert searchGroup.totalHits().relation() == TotalHits.Relation.EQUAL_TO;

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/CrossCollectionJoinQuery.java:
##########
@@ -323,7 +316,7 @@ private DocSet getDocSet() throws IOException {
     }
 
     @Override
-    public Scorer scorer(LeafReaderContext context) throws IOException {
+    public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/java/org/apache/solr/search/mlt/SimpleMLTQParser.java:
##########
@@ -47,7 +47,7 @@ public Query parse() {
 
     try {
       TopDocs td = searcher.search(docIdQuery, 2);
-      if (td.totalHits.value != 1)
+      if (td.totalHits.value() != 1)

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/MultiValueTermOrdinalCollector.java:
##########
@@ -55,8 +55,9 @@ public void collect(int doc) throws IOException {
     final int globalDoc = docBase + doc;
 
     if (topLevelDocValues.advanceExact(globalDoc)) {
-      long ord = SortedSetDocValues.NO_MORE_ORDS;
-      while ((ord = topLevelDocValues.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      long ord;

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java:
##########
@@ -150,7 +150,7 @@ private void verify(Path backup, int nDocs) throws IOException {
         IndexReader reader = DirectoryReader.open(dir)) {
       IndexSearcher searcher = new IndexSearcher(reader);
       TopDocs hits = searcher.search(new MatchAllDocsQuery(), 1);
-      assertEquals(nDocs, hits.totalHits.value);
+      assertEquals(nDocs, hits.totalHits.value());

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java:
##########
@@ -587,9 +587,9 @@ public static void setMinShouldMatch(BooleanQuery.Builder q, String spec, boolea
     int maxDisjunctsSize = 0;
     int optionalDismaxClauses = 0;
     for (BooleanClause c : q.build().clauses()) {
-      if (c.getOccur() == Occur.SHOULD) {
-        if (mmAutoRelax && c.getQuery() instanceof DisjunctionMaxQuery) {
-          int numDisjuncts = ((DisjunctionMaxQuery) c.getQuery()).getDisjuncts().size();
+      if (c.occur() == Occur.SHOULD) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java:
##########
@@ -331,7 +331,8 @@ private void validateBackup(final File backup) throws IOException {
     final int numRealDocsExpected = Integer.parseInt(m.group());
 
     try (Directory dir = FSDirectory.open(backup.toPath())) {
-      TestUtil.checkIndex(dir, true, true, true, null);
+      //TBD

Review Comment:
   [-1] The "level" parameter for TestUtil.checkIndex [is expected to be 1, 2, or 3](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java#L4499-L4503), so I'd expect this to throw an exception and fail the test.



##########
solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java:
##########
@@ -763,7 +763,7 @@ public void testNotLazyField() throws IOException {
     core.execute(core.getRequestHandler(req.getParams().get(CommonParams.QT)), req, rsp);
 
     DocList dl = ((ResultContext) rsp.getResponse()).getDocList();
-    Document d = req.getSearcher().doc(dl.iterator().nextDoc());
+    Document d = req.getSearcher().storedFields().document(dl.iterator().nextDoc());

Review Comment:
   [INFO] Document field values are now accessed through the `storedFields()` method in order to facilitate some Lucene API and tech-debt cleanup, see https://github.com/apache/lucene/pull/11998



##########
solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java:
##########
@@ -73,30 +73,30 @@ public void transform(
         FieldType groupFieldType = groupField.getType();
         for (GroupDocs<BytesRef> group : topGroups.groups) {
           SimpleOrderedMap<Object> groupResult = new SimpleOrderedMap<>();
-          if (group.groupValue != null) {
+          if (group.groupValue() != null) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/GraphQuery.java:
##########
@@ -272,19 +261,19 @@ private Automaton buildAutomaton(BytesRefHash termBytesHash) {
         termBytesHash.get(i, ref);
         terms.add(ref);
       }
-      final Automaton a = DaciukMihovAutomatonBuilder.build(terms);
+      final Automaton a = Automata.makeStringUnion(terms);

Review Comment:
   [INFO] Older class hidden to shrink Lucene API surface in https://github.com/apache/lucene/issues/12321



##########
solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/MainEndResultTransformer.java:
##########
@@ -58,7 +58,7 @@ public void transform(
 
       float maxScore = Float.NEGATIVE_INFINITY;
       for (GroupDocs<BytesRef> group : topGroups.groups) {
-        for (ScoreDoc scoreDoc : group.scoreDocs) {
+        for (ScoreDoc scoreDoc : group.scoreDocs()) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java:
##########
@@ -46,7 +46,7 @@ public ShardRequest[] constructRequest(ResponseBuilder rb) {
     HashMap<String, Set<ShardDoc>> shardMap = new HashMap<>();
     for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
       for (GroupDocs<BytesRef> group : topGroups.groups) {
-        mapShardToDocs(shardMap, group.scoreDocs);
+        mapShardToDocs(shardMap, group.scoreDocs());

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/BlockJoinParentQParser.java:
##########
@@ -155,13 +149,13 @@ public Weight createWeight(
         throws IOException {
       return new ConstantScoreWeight(BitSetProducerQuery.this, boost) {
         @Override
-        public Scorer scorer(LeafReaderContext context) throws IOException {
+        public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java:
##########
@@ -147,7 +147,8 @@ void addEdgeIdsToResult(int doc) throws IOException {
       if (doc == docTermOrds.docID()) {
         BytesRef edgeValue = new BytesRef();
         long ord;
-        while ((ord = docTermOrds.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+        for (int o=0; o<docTermOrds.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/SimpleEndResultTransformer.java:
##########
@@ -55,7 +55,7 @@ public void transform(
 
         float maxScore = Float.NEGATIVE_INFINITY;
         for (GroupDocs<BytesRef> group : topGroups.groups) {
-          for (ScoreDoc scoreDoc : group.scoreDocs) {
+          for (ScoreDoc scoreDoc : group.scoreDocs()) {

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java:
##########
@@ -196,7 +197,7 @@ private Automaton buildAutomaton(BytesRefHash termBytesHash) {
         termBytesHash.get(i, ref);
         terms.add(ref);
       }
-      final Automaton a = DaciukMihovAutomatonBuilder.build(terms);
+      final Automaton a = Automata.makeStringUnion(terms);

Review Comment:
   [INFO] Older class hidden to shrink Lucene API surface in https://github.com/apache/lucene/issues/12321



##########
solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java:
##########
@@ -763,7 +763,7 @@ public SolrParams parseParamsAndFillStreams(
         // Protect container owned streams from being closed by us, see SOLR-8933
         in =
             FastInputStream.wrap(
-                in == null ? new CloseShieldInputStream(req.getInputStream()) : in);
+                in == null ? new CloseShieldInputStream(req.getInputStream()) : new CloseShieldInputStream(in));

Review Comment:
   [Q] This doesn't look like a bad change necessarily, but I'm a little leery of bundling in things unrelated to the Lucene version bump.  (Assuming I'm right and this is unrelated?)



##########
solr/core/src/java/org/apache/solr/search/join/GraphQuery.java:
##########
@@ -272,19 +261,19 @@ private Automaton buildAutomaton(BytesRefHash termBytesHash) {
         termBytesHash.get(i, ref);
         terms.add(ref);
       }
-      final Automaton a = DaciukMihovAutomatonBuilder.build(terms);
+      final Automaton a = Automata.makeStringUnion(terms);
       return a;
     }
 
     @Override
-    public Scorer scorer(LeafReaderContext context) throws IOException {
+    public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/java/org/apache/solr/search/join/GraphQuery.java:
##########
@@ -256,7 +245,7 @@ private DocSet resolveLeafNodes() throws IOException {
       BooleanQuery.Builder leafNodeQuery = new BooleanQuery.Builder();
       Query edgeQuery =
           collectSchemaField.hasDocValues()
-              ? new DocValuesFieldExistsQuery(field)
+              ? new FieldExistsQuery(field)

Review Comment:
   ditto, re: "FieldExistsQuery consolidation"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050770517)



##########
solr/core/src/java/org/apache/solr/search/mlt/AbstractMLTQParser.java:
##########
@@ -136,7 +136,7 @@ protected BooleanQuery parseMLTQuery(Supplier<String[]> fieldsFallback, MLTInvok
       newQ.setMinimumNumberShouldMatch(rawMLTQuery.getMinimumNumberShouldMatch());
 
       for (BooleanClause clause : rawMLTQuery) {
-        Query q = clause.getQuery();
+        Query q = clause.query();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/join/ScoreJoinQParserPlugin.java:
##########
@@ -138,7 +138,7 @@ public Weight createWeight(
         fromCore.close();
         fromHolder.decref();
       }
-      return joinQuery.rewrite(searcher.getIndexReader()).createWeight(searcher, scoreMode, boost);
+      return joinQuery.rewrite(searcher).createWeight(searcher, scoreMode, boost);

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java:
##########
@@ -54,12 +49,12 @@ LeafReader wrap(LeafReader reader) {
   // we try to be well-behaved, but we are not (and IW's applyQueryDeletes isn't much better...)
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
-    Query rewritten = in.rewrite(reader);
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/join/HashRangeQuery.java:
##########
@@ -64,7 +56,7 @@ public boolean isCacheable(LeafReaderContext context) {
       }
 
       @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
+      public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/java/org/apache/solr/spelling/WordBreakSolrSpellChecker.java:
##########
@@ -226,8 +226,8 @@ public SpellingResult getSuggestions(SpellingOptions options) throws IOException
     if (combineWords) {
       combineSuggestionList = new ArrayList<>(combineSuggestions.length);
       for (CombineSuggestion cs : combineSuggestions) {
-        int firstTermIndex = cs.originalTermIndexes[0];
-        int lastTermIndex = cs.originalTermIndexes[cs.originalTermIndexes.length - 1];
+        int firstTermIndex = cs.originalTermIndexes()[0];

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/uninverting/UninvertingReader.java:
##########
@@ -285,11 +274,12 @@ public static LeafReader wrap(LeafReader in, Function<String, Type> mapping) {
             new FieldInfo(
                 fi.name,
                 fi.number,
-                fi.hasVectors(),
+                fi.hasTermVectors(),
                 fi.omitsNorms(),
                 fi.hasPayloads(),
                 fi.getIndexOptions(),
                 type,
+                DocValuesSkipIndexType.NONE,

Review Comment:
   ditto, re: "sparse index skip list capability"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050785064) that expands on this a bit more



##########
solr/core/src/java/org/apache/solr/update/SolrIndexSplitter.java:
##########
@@ -551,7 +544,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
       return new ConstantScoreWeight(this, boost) {
 
         @Override
-        public Scorer scorer(LeafReaderContext context) throws IOException {
+        public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



##########
solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessor.java:
##########
@@ -130,7 +130,7 @@ public void processAdd(AddUpdateCommand cmd) throws IOException {
           classifier.getClasses(luceneDocument, maxOutputClasses);
       if (assignedClassifications != null) {
         for (ClassificationResult<BytesRef> singleClassification : assignedClassifications) {
-          String assignedClass = singleClassification.getAssignedClass().utf8ToString();
+          String assignedClass = singleClassification.assignedClass().utf8ToString();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test-files/solr/collection1/conf/schema_codec.xml:
##########
@@ -20,7 +20,7 @@
        as a way to vet that the configuration actually matters.
   -->
   <fieldType name="string_direct" class="solr.StrField" postingsFormat="Direct" docValuesFormat="Asserting" />
-  <fieldType name="string_standard" class="solr.StrField" postingsFormat="Lucene912"/>
+  <fieldType name="string_standard" class="solr.StrField" postingsFormat="Lucene101"/>

Review Comment:
   [Q] Isn't this the default?  Why specify it here?



##########
solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java:
##########
@@ -573,7 +573,7 @@ public void testFqWithCacheAndCostLocalParams() throws Exception {
           assertEquals(2, booleanQuery.clauses().size());
           // the first clause is the original query, which is a WrappedQuery because the cache=false
           // local param was provided; the WrappedQuery doesn't cache; it contains a TermQuery
-          Query firstClause = booleanQuery.clauses().get(0).getQuery();
+          Query firstClause = booleanQuery.clauses().get(0).query();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/test/org/apache/solr/handler/TestSnapshotCoreBackup.java:
##########
@@ -454,7 +454,7 @@ private static void simpleBackupCheck(
           new File(backup, expectedSegmentsFileName).exists());
     }
     try (Directory dir = FSDirectory.open(backup.toPath())) {
-      TestUtil.checkIndex(dir, true, true, true, null);
+      TestUtil.checkIndex(dir, 0, true, true, null);

Review Comment:
   [-1] The "level" parameter for TestUtil.checkIndex [is expected to be 1, 2, or 3](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java#L4499-L4503), so I'd expect this to throw an exception and fail the test.



##########
solr/core/src/java/org/apache/solr/update/DeleteByQueryWrapper.java:
##########
@@ -77,8 +72,8 @@ public Explanation explain(LeafReaderContext context, int doc) throws IOExceptio
       }
 
       @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
-        return inner.scorer(privateContext.getIndexReader().leaves().get(0));
+      public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "bruno-roustant (via GitHub)" <gi...@apache.org>.
bruno-roustant commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2903926088

   Fyi @antogruz and I are going to help on this PR. We'll first review and then propose new commits to fix tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3156889838

   The grouping implementation was only using filter queries for search ignoring the main query entirely. This caused function queries like {\!func}foo2_i to be ignored during grouping, resulting in all groups receiving a score of 1.0 from MatchAllDocsQuery instead of proper function query scores.
       
   This broke group ordering when Sort.RELEVANCE was used (the default), as groups were not ordered by their maximum scores as expected.
   
   The fix uses QueryUtils.combineQueryAndFilter() to properly combine the main query (for scoring) with filter queries (for filtering), matching the behavior of normal Solr search operations. This ensures function queries and other scoring queries work correctly with grouping.
       
   Hence, these are now fixed: TestFiltering, TestGroupingSearch and TestDistributedGrouping.
   
   Now, the tests that are remaining are:
   
   ```
   org.apache.solr.analysis.PathHierarchyTokenizerFactoryTest
   org.apache.solr.TestRandomDVFaceting
   org.apache.solr.handler.TestSnapshotCoreBackup
   org.apache.solr.search.TestComplexPhraseLeadingWildcard
   org.apache.solr.schema.PreAnalyzedFieldTest
   org.apache.solr.search.TestQueryLimits
   org.apache.solr.uninverting.TestFieldCacheVsDocValues
   org.apache.solr.uninverting.TestFieldCache
   org.apache.solr.update.processor.PreAnalyzedUpdateProcessorTest
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3164836927

   > [Solr Script Tests / Run Solr Script Tests (pull_request)](https://github.com/apache/solr/actions/runs/16809084447/job/47609370778?pr=3053)Started Aug 7, 2025 — This check has started...
   
   https://github.com/apache/solr/actions/runs/16809084447/job/47609370778?pr=3053
   
   This check seems to be hung, even though I see no errors. All other checks have passed.
   I'm inclined to ignore it for now, fix it later in case there is something wrong with this branch after it has been merged to main.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "aruggero (via GitHub)" <gi...@apache.org>.
aruggero commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3164910752

   Hi Ishan,
   Is the test you are talking about the: ltr_expensiveFeatureRescoring_shouldTimeOutAndReturnPartialResults?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2288536568


##########
solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java:
##########
@@ -334,7 +334,7 @@ private void validateBackup(final Path backup) throws IOException {
     final int numRealDocsExpected = Integer.parseInt(m.group());
 
     try (Directory dir = FSDirectory.open(backup)) {
-      TestUtil.checkIndex(dir, true, true, true, null);
+      TestUtil.checkIndex(dir, 0, true, true, null);

Review Comment:
   Wondering if something other than `0` should be used here:
    * https://github.com/apache/lucene/blob/releases/lucene/10.2.1/lucene/test-framework/src/java/org/apache/lucene/tests/util/TestUtil.java#L304-L322
    * https://github.com/apache/lucene/blob/releases/lucene/10.2.1/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java#L4270-L4286



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1928852796


##########
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java:
##########
@@ -582,7 +572,6 @@ public float score() {
       return score;
     }
 
-    @Override
     public int docID() {
       return docId;
     }

Review Comment:
   Likely this can be removed, haven't tried it yet though.
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2836309092

   Ran out of time to move this forward, so others should feel free to pick this up without fear of duplicating work, etc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2050864362


##########
solr/core/src/java/org/apache/solr/search/DocSetQuery.java:
##########
@@ -80,12 +73,12 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
       throws IOException {
     return new ConstantScoreWeight(this, boost) {
       @Override
-      public Scorer scorer(LeafReaderContext context) {
+      public ScorerSupplier scorerSupplier(LeafReaderContext context) {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/JoinQuery.java:
##########
@@ -154,7 +147,7 @@ public JoinQueryWeight(SolrIndexSearcher searcher, ScoreMode scoreMode, float bo
     DocSet resultSet;
 
     @Override
-    public Scorer scorer(LeafReaderContext context) throws IOException {
+    public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/SolrDocumentFetcher.java:
##########
@@ -683,9 +678,8 @@ else if (e.schemaField.multiValued() == false) {
         final SortedSetDocValues values = e.getSortedSetDocValues(localId, leafReader, readerOrd);
         if (values != null) {
           final List<Object> outValues = new ArrayList<>();
-          for (long ord = values.nextOrd();
-              ord != SortedSetDocValues.NO_MORE_ORDS;
-              ord = values.nextOrd()) {
+          for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByArrayDV.java:
##########
@@ -272,9 +272,8 @@ private void collectPerSeg(SortedSetDocValues multiDv, SweepDISI disi, LongValue
     while ((doc = disi.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
       if (multiDv.advanceExact(doc)) {
         final int maxIdx = disi.registerCounts(segCounter);
-        for (; ; ) {
+        for (int o=0; o<multiDv.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/SumsqAgg.java:
##########
@@ -94,7 +94,8 @@ public SumSqSortedSetAcc(FacetContext fcontext, SchemaField sf, int numSlots)
     @Override
     protected void collectValues(int doc, int slot) throws IOException {
       long ord;
-      while ((ord = values.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/MissingAgg.java:
##########
@@ -45,7 +45,7 @@ public SlotAcc createSlotAcc(FacetContext fcontext, long numDocs, int numSlots)
       if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {
         Query query = null;
         if (sf.hasDocValues()) {
-          query = new DocValuesFieldExistsQuery(sf.getName());
+          query = new FieldExistsQuery(sf.getName());

Review Comment:
   ditto, re: "FieldExistsQuery consolidation"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050770517) 



##########
solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java:
##########
@@ -253,7 +242,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
       return new ConstantScoreWeight(this, boost) {
 
         @Override
-        public Scorer scorer(LeafReaderContext context) throws IOException {
+        public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/command/QueryCommand.java:
##########
@@ -166,9 +159,9 @@ public List<Collector> create() throws IOException {
     Collector subCollector;
     if (sort == null || sort.equals(Sort.RELEVANCE)) {
       subCollector =
-          topDocsCollector = TopScoreDocCollector.create(docsToCollect, Integer.MAX_VALUE);
+          topDocsCollector = new TopScoreDocCollectorManager(docsToCollect, Integer.MAX_VALUE).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245)



##########
solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java:
##########
@@ -245,12 +244,6 @@ public NamedList<NamedList<Object>> processResult(
    */
   private void searchWithTimeLimiter(Query query, ProcessedFilter filter, Collector collector)
       throws IOException {
-    if (queryCommand.getTimeAllowed() > 0) {

Review Comment:
   [INFO] [LUCENE-10151](https://issues.apache.org/jira/browse/LUCENE-10151) added timeout support to IndexSearcher via a `IndexSearcher.setTimeout()` method, superseding the TImeLimitingCollector previously offered by Lucene.  TLC was officially deprecated in https://github.com/apache/lucene/pull/13220 and removed for Lucene 10.
   
   That said...
   
   [Q] Is `IndexSearcher.setTimeout()` sufficient for what Solr needs?  AFAIK, we allow users to specify timeouts on a per-query basis, and I can't imagine how an IndexSearcher-wide setting would support that?  Should the "searchWithTimeLimiter" method even exist any more, now that there's nothing here that's time-limiting specific?



##########
solr/core/src/java/org/apache/solr/search/MultiThreadedSearcher.java:
##########
@@ -341,7 +341,7 @@ public Object reduce(Collection collectors) throws IOException {
         } else {
           mergedTopDocs = TopDocs.merge(0, len, topDocs);
         }
-        totalHits = (int) mergedTopDocs.totalHits.value;
+        totalHits = (int) mergedTopDocs.totalHits.value();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/QueryUtils.java:
##########
@@ -164,7 +164,7 @@ public static Query getAbs(Query q) {
 
     if (clauses.size() == 1) {
       // if only one clause, dispense with the wrapping BooleanQuery
-      Query negClause = clauses.iterator().next().getQuery();
+      Query negClause = clauses.iterator().next().query();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/NumericHidingLeafReader.java:
##########
@@ -63,11 +56,12 @@ private NumericHidingLeafReader(LeafReader in, String field) {
             new FieldInfo(
                 fi.name,
                 fi.number,
-                fi.hasVectors(),
+                fi.hasTermVectors(),
                 fi.omitsNorms(),
                 fi.hasPayloads(),
                 fi.getIndexOptions(),
                 DocValuesType.NONE,
+                DocValuesSkipIndexType.NONE,

Review Comment:
   ditto, re: "sparse index skip list capability"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050785064) that expands on this a bit more



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -2405,10 +2408,10 @@ protected void sortDocSet(QueryResult qr, QueryCommand cmd) throws IOException {
       ids[i] = scoreDoc.doc;
     }
 
-    assert topDocs.totalHits.relation == TotalHits.Relation.EQUAL_TO;
+    assert topDocs.totalHits.relation() == TotalHits.Relation.EQUAL_TO;

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/MatchCostQuery.java:
##########
@@ -99,16 +90,16 @@ public Explanation explain(LeafReaderContext context, int doc) throws IOExceptio
       // scorer() so that we can wrap TPI
 
       @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
+      public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/QueryParsing.java:
##########
@@ -298,7 +298,7 @@ public static void toString(Query query, IndexSchema schema, Appendable out, int
         } else if (c.isRequired()) {
           out.append('+');
         }
-        Query subQuery = c.getQuery();
+        Query subQuery = c.query();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/ReRankCollector.java:
##########
@@ -86,12 +76,12 @@ public ReRankCollector(
     if (sort == null) {
       this.sort = null;
       this.mainCollector =
-          TopScoreDocCollector.create(Math.max(this.reRankDocs, length), cmd.getMinExactCount());
+          new TopScoreDocCollectorManager(Math.max(this.reRankDocs, length), cmd.getMinExactCount()).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245) 



##########
solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java:
##########
@@ -229,7 +212,7 @@ public Weight createWeight(IndexSearcher searcher, final ScoreMode scoreMode, fl
 
       return new ConstantScoreWeight(this, boost) {
         @Override
-        public Scorer scorer(LeafReaderContext context) throws IOException {
+        public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/WrappedQuery.java:
##########
@@ -47,9 +47,9 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
   }
 
   @Override
-  public Query rewrite(IndexReader reader) throws IOException {
+  public Query rewrite(IndexSearcher searcher) throws IOException {

Review Comment:
   ditto, re: "rewrite API change"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050789458)



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -1862,14 +1865,14 @@ TopDocsCollector<? extends ScoreDoc> buildTopDocsCollector(int len, QueryCommand
 
     if (null == cmd.getSort()) {
       assert null == cmd.getCursorMark() : "have cursor but no sort";
-      return TopScoreDocCollector.create(len, minNumFound);
+      return new TopScoreDocCollectorManager(len, minNumFound).newCollector();

Review Comment:
   ditto, re: "Collector vs. CollectorManager"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050713245) 



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -298,12 +297,10 @@ private Collector buildAndRunCollectorChain(
       collector = new EarlyTerminatingCollector(collector, cmd.getLen());
     }
 
-    final long timeAllowed = cmd.getTimeAllowed();
+/*    final long timeAllowed = cmd.getTimeAllowed();

Review Comment:
   [Q] @chatman or anyone else have context on all the commented out code this diff adds?  Looks a bit like some temporary test debugging that got added to the branch - if so, is it still needed? 



##########
solr/core/src/java/org/apache/solr/search/function/ValueSourceRangeFilter.java:
##########
@@ -111,12 +104,12 @@ public Explanation explain(LeafReaderContext context, int doc) throws IOExceptio
     }
 
     @Override
-    public Scorer scorer(LeafReaderContext context) throws IOException {
+    public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/facet/AvgAgg.java:
##########
@@ -152,7 +152,8 @@ public AvgSortedSetAcc(FacetContext fcontext, SchemaField sf, int numSlots) thro
     @Override
     protected void collectValues(int doc, int slot) throws IOException {
       long ord;
-      while ((ord = values.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/CountValsAgg.java:
##########
@@ -102,7 +102,8 @@ public CountSortedSetDVAcc(FacetContext fcontext, SchemaField sf, int numSlots)
 
     @Override
     protected void collectValues(int doc, int slot) throws IOException {
-      while (values.nextOrd() != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java:
##########
@@ -87,7 +79,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo
       final boolean toMultivalued = toSearcher.getSchema().getFieldOrNull(toField).multiValued();
       return new ConstantScoreWeight(this, boost) {
         @Override
-        public Scorer scorer(LeafReaderContext context) throws IOException {
+        public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException {

Review Comment:
   ditto, re: "Scorer vs. ScorerSupplier" 
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050863372) 



##########
solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessorByEnumTermsStream.java:
##########
@@ -301,15 +301,15 @@ private SimpleOrderedMap<Object> _nextBucket() throws IOException {
             for (int subindex = 0; subindex < numSubs; subindex++) {
               MultiPostingsEnum.EnumWithSlice sub = subs[subindex];
               if (sub.postingsEnum == null) continue;
-              int base = sub.slice.start;
+              int base = sub.slice.start();

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/facet/UniqueMultiDvSlotAcc.java:
##########
@@ -85,11 +85,11 @@ public void collect(int doc, int slotNum, IntFunction<SlotContext> slotContext)
         arr[slotNum] = bits;
       }
 
-      do {
+      for(int o=0; o<subDv.docValueCount(); o++) { // nocommit verify if this is correct

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/MinMaxAgg.java:
##########
@@ -540,7 +540,8 @@ public void collectValues(int doc, int slotNum) throws IOException {
         newOrd = subDv.nextOrd();
       } else { // max
         long ord;
-        while ((ord = subDv.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+        for (int o=0; o<subDv.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/grouping/distributed/command/GroupConverter.java:
##########
@@ -150,22 +150,22 @@ static TopGroups<BytesRef> fromMutable(SchemaField field, TopGroups<MutableValue
     for (int i = 0; i < values.groups.length; i++) {
       GroupDocs<MutableValue> original = values.groups[i];
       final BytesRef groupValue;
-      if (original.groupValue.exists) {
+      if (original.groupValue().exists) {
         BytesRefBuilder binary = new BytesRefBuilder();
         fieldType.readableToIndexed(
-            Utils.OBJECT_TO_STRING.apply(original.groupValue.toObject()), binary);
+            Utils.OBJECT_TO_STRING.apply(original.groupValue().toObject()), binary);
         groupValue = binary.get();
       } else {
         groupValue = null;
       }
       groupDocs[i] =
           new GroupDocs<>(
-              original.score,
-              original.maxScore,
-              original.totalHits,
-              original.scoreDocs,
+              original.score(),

Review Comment:
   ditto, re: "Lucene movement towards Java 'records'"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050683426)



##########
solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java:
##########
@@ -355,7 +355,8 @@ protected void collectValues(int doc, int slot) throws IOException {
         digests[slot] = digest = new AVLTreeDigest(100);
       }
       long ord;
-      while ((ord = values.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/DocValuesAcc.java:
##########
@@ -376,7 +376,8 @@ public SDVSortedSetAcc(FacetContext fcontext, SchemaField sf, int numSlots) thro
     @Override
     protected void collectValues(int doc, int slot) throws IOException {
       long ord;
-      while ((ord = values.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



##########
solr/core/src/java/org/apache/solr/search/facet/SumAgg.java:
##########
@@ -107,7 +107,8 @@ public SumSortedSetAcc(FacetContext fcontext, SchemaField sf, int numSlots) thro
     @Override
     protected void collectValues(int doc, int slot) throws IOException {
       long ord;
-      while ((ord = values.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+      for (int o=0; o<values.docValueCount(); o++) {

Review Comment:
   ditto, re: "docValue iteration"
   
   See [comment here](https://github.com/apache/solr/pull/3053#discussion_r2050762921)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2291568642


##########
solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java:
##########
@@ -334,7 +334,7 @@ private void validateBackup(final Path backup) throws IOException {
     final int numRealDocsExpected = Integer.parseInt(m.group());
 
     try (Directory dir = FSDirectory.open(backup)) {
-      TestUtil.checkIndex(dir, true, true, true, null);
+      TestUtil.checkIndex(dir, 0, true, true, null);

Review Comment:
   Opened #3495 as follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3164889160

   I think I deleted some .lockfiles inadvertently. I'm working on fixing it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165355972

   I'm only "blaming" you for not following a best practice (twice now) on big/important PRs.  Nothing more.  If neither broke things I wouldn't be happy but probably wouldn't have said anything.
   
   It's tempting to say this was already reviewed, which is somewhat true (people looked at it and offered to help) but that's different than an explicit approval.  Reviewing a change (before merge) is an industry standard best practice, and it is is such for good reason -- it leads to better quality software and reduces the chance of breaking the build (which annoys the dev community).  Cleanup/fix commits are permanent annoyance (we're not going to force push a rebase of main to fix); should be minimized.   CTR allows us to use our judgement on when to merge exactly, but that doesn't mean we (as professional software engineers that strive for quality software) don't agree with peer review before merging.  It means we trust you to consider the factors and merge anyway if you feel its warranted.  I don't think Anshum's proposed feature freeze date creates true urgency here but if you disagree then announce your plan to commit in 1 day.  It's common for interested people to delay givi
 ng a PR a look until hearing that it's ready.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2267362807


##########
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java:
##########
@@ -22,7 +22,7 @@
 import java.io.UncheckedIOException;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.DocValuesFieldExistsQuery;
+import org.apache.lucene.search.FieldExistsQuery;

Review Comment:
   no longer applicable: https://github.com/apache/solr/pull/2632#issuecomment-3175763315



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2981826918

   @HoustonPutman @antonmry I've updated to Lucene 10.2.1 based on @dsmiley's suggestion. However, now I see some compiler errors for LTRScoringQuery.java, which I suppose was not there a while ago. Not sure if I did something inadvertently to introduce those errors? FYI @cpoerschke.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2607786041

   Now, here's the list of failing tests:
   
   ```TestRandomDVFaceting
   TestReversedWildcardFilterFactory
   TestGroupingSearch
   BasicFunctionalityTest
   TestDistributedGrouping
   TestDistributedSearch
   BasicDistributedZk2Test
   TestSegmentSorting
   DebugComponentTest
   DistributedFacetPivotLargeTest
   SOLR749Test
   TestIntervalFaceting
   PreAnalyzedFieldTest
   TestCloudJSONFacetJoinDomain
   TestComplexPhraseLeadingWildcard
   TestMissingGroups
   QueryElevationComponentTest
   TestFieldCacheSortRandom
   TestJsonFacetRefinement
   SimpleFacetsTest
   LargeFieldTest
   TestUninvertingReader
   TestQueryLimits
   TestFiltering
   TestTermsQParserPlugin
   TestCloudJSONFacetSKGEquiv
   PreAnalyzedUpdateProcessorTest
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2301567701


##########
solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java:
##########
@@ -97,7 +97,7 @@ public void init(NamedList<?> args) {
       log.debug("Using default compressionMode: {}", compressionMode);
     }
     codec =
-        new Lucene912Codec(compressionMode) {
+        new Lucene101Codec(compressionMode) {

Review Comment:
   #3513 to explore using `Lucene102...` instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263628875


##########
solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java:
##########
@@ -97,7 +97,7 @@ public void init(NamedList<?> args) {
       log.debug("Using default compressionMode: {}", compressionMode);
     }
     codec =
-        new Lucene912Codec(compressionMode) {
+        new Lucene101Codec(compressionMode) {

Review Comment:
   There's `Lucene102...` also now, wondering if we might want that instead of `Lucene101...` then: https://github.com/apache/lucene/tree/releases/lucene/10.2.2/lucene/core/src/java/org/apache/lucene/codecs/lucene102



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263687415


##########
solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java:
##########
@@ -736,7 +736,9 @@ public SolrParams parseParamsAndFillStreams(
         // Protect container owned streams from being closed by us, see SOLR-8933
         in =
             FastInputStream.wrap(
-                in == null ? new CloseShieldInputStream(req.getInputStream()) : in);
+                in == null
+                    ? new CloseShieldInputStream(req.getInputStream())
+                    : new CloseShieldInputStream(in));

Review Comment:
   note-to-self bookmark: would like to understand more about this change here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3163251538

   I was so focused on Solr core test failures that I totally forgot about the rest. Now that I have a handle on the core tests (I'll push the changes here shortly), I discovered the following failures:
   
   ```
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.cli.TestSolrCLIRunExample.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.component.StatsComponentTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.handler.admin.ShowFileRequestHandlerTest.txt
   ./solr/core/build/test-results/test/outputs/OUTPUT-org.apache.solr.uninverting.TestFieldCacheSortRandom.txt
   ./solr/solr-ref-guide/build/test-results/test/outputs/OUTPUT-UsingPingRefGuideExamplesTest.txt
   ./solr/solr-ref-guide/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.ref_guide_examples.UsingSolrJRefGuideExamplesTest.txt
   ./solr/solr-ref-guide/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.ref_guide_examples.IndexingNestedDocuments.txt
   ./solr/solr-ref-guide/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.ref_guide_examples.JsonRequestApiTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.SolrExampleBinaryTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleEmbeddedTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleStreamingTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.ConcurrentUpdateHttp2SolrClientTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.HttpJdkSolrClientTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.SolrExampleBinaryHttp2Test.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleStreamingHttp2Test.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.BasicHttpSolrClientTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.request.json.JsonQueryRequestFacetingIntegrationTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.GetByIdTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.SolrExampleXMLTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.ConcurrentUpdateHttp2SolrClientMultiCollectionTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClientTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.TestSolrJErrorHandling.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.HttpSolrClientSSLAuthConPoolTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.LargeVolumeJettyTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.LargeVolumeEmbeddedTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.response.TermsResponseTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleStreamingBinaryHttp2Test.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleStreamingBinaryTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClientMultiCollectionTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.HttpSolrClientConPoolTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.response.TestSuggesterResponse.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.SolrExampleCborTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.TestBatchUpdate.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.LargeVolumeBinaryJettyTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleJettyTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.embedded.SolrExampleXMLHttp2Test.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.impl.Http2SolrClientTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.request.json.DirectJsonQueryRequestFacetingIntegrationTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.request.json.JsonQueryRequestIntegrationTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.response.NoOpResponseParserTest.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.response.TestSpellCheckResponse.txt
   ./solr/solrj/build/test-results/test/outputs/OUTPUT-org.apache.solr.client.solrj.request.json.DirectJsonQueryRequestFacetingEmbeddedTest.txt
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263727856


##########
solr/core/src/java/org/apache/solr/request/DocValuesStats.java:
##########
@@ -222,7 +222,9 @@ static int accumMulti(
       }
       if (doc == si.docID()) {
         long ord;
-        while ((ord = si.nextOrd()) != SortedSetDocValues.NO_MORE_ORDS) {
+        // while ((ord = si.nextOrd()) != SortedSetDocValues.NO_MORE_DOCS) {

Review Comment:
   nit: commented out code



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3164842798

   Thank you to everyone for help!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2610037402

   List of failing tests now:
   ```TestReversedWildcardFilterFactory
   TestGroupingSearch
   TestJoin
   PathHierarchyTokenizerFactoryTest
   BasicFunctionalityTest
   TestDistributedGrouping
   TestSnapshotCoreBackup
   DistributedSpellCheckComponentTest
   TestSegmentSorting
   SOLR749Test
   TestFieldCacheVsDocValues
   TestIntervalFaceting
   PreAnalyzedFieldTest
   TestComplexPhraseLeadingWildcard
   QueryElevationComponentTest
   LargeFieldTest
   TestQueryLimits
   TestGraphTermsQParserPlugin
   TestTermsQParserPlugin
   TestFiltering
   TestFieldCache
   PreAnalyzedUpdateProcessorTest
   TestUninvertingReader
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "gerlowskija (via GitHub)" <gi...@apache.org>.
gerlowskija commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2820948089

   `PreAnalyzedUpdateProcessorTest` is failing because the URP being tested relies on a weird quirk in Lucene's `Field` API that was closed up starting in 10.0.  Specifically: having a custom value _and_ a TokenStream on the same field.  This was explicitly prevented by https://github.com/apache/lucene/pull/12053 (see the comment [here](https://github.com/apache/lucene/pull/12053#issuecomment-1369783917)).
   
   Maybe someone can find a way around this change in Lucene, but given the obscurity of the URP in question, I wonder whether this might make it a reasonable candidate for removal.  Curious what everyone thinks...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263827463


##########
solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java:
##########
@@ -118,7 +118,7 @@ public void testTieredMPSolrIndexConfigCreation() throws Exception {
     ConcurrentMergeScheduler ms = (ConcurrentMergeScheduler) iwc.getMergeScheduler();
     assertEquals("ms.maxMergeCount", 987, ms.getMaxMergeCount());
     assertEquals("ms.maxThreadCount", 42, ms.getMaxThreadCount());
-    assertTrue("ms.isAutoIOThrottle", ms.getAutoIOThrottle());
+    assertFalse("ms.isAutoIOThrottle", ms.getAutoIOThrottle());

Review Comment:
   Looks like Lucene's default changed and so something like #3459 is needed to match.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263569503


##########
gradle/libs.versions.toml:
##########
@@ -37,8 +37,8 @@ apache-httpcomponents-httpcore = "4.4.16"
 apache-httpcomponents-httpmime = "4.5.14"
 apache-kafka = "3.9.0"
 apache-log4j = "2.21.0"
-apache-lucene = "9.12.2"
-apache-opennlp = "1.9.4"
+apache-lucene = "10.2.1"

Review Comment:
   Perhaps latest i.e. `10.2.1 --> 10.2.2` could/should be a follow-up?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2263724040


##########
solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java:
##########
@@ -112,14 +113,20 @@ public static LeafReader wrap(IndexReader reader) throws IOException {
       LeafMetaData leafMetaData = reader.leaves().get(0).reader().getMetaData();
       metaData =
           new LeafMetaData(
-              leafMetaData.getCreatedVersionMajor(),
+              leafMetaData.createdVersionMajor(),
               minVersion,
-              leafMetaData.getSort(),
+              leafMetaData.sort(),
               leafMetaData.hasBlocks());
     }
     fieldInfos = FieldInfos.getMergedFieldInfos(in);
   }
 
+  @Override
+  public DocValuesSkipper getDocValuesSkipper(String field) throws IOException {

Review Comment:
   I like the idea of a JIRA and it could be referenced in the code; _"TODO implement skipping"_ on its own can appear concerning i.e. intentional vs. accidental omission.
   
   https://github.com/apache/lucene/blob/releases/lucene/10.2.1/lucene/core/src/java/org/apache/lucene/index/LeafReader.java#L205-L210 reassures that `null` means _"a skip index was not indexed"_ here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-3165302672

   >     But I've got to say, it's premature to merge a PR without either first seeking and getting another approval or to state your intention to merge in 48 hours. This isn't a triival PR (of course). I don't want other committers (esp. new ones) or contributors to think this is normal. It's not. The same thing happened with the multiThreaded PR, which didn't turn out well, as you know.
   
   To add to what I've already mentioned: please understand that it is better to leverage community hardware (ASF and Uwe's Jenkins) to vet this thoroughly than rely on me running it again and again on my servers. I'm not paid to do any of this, I'm volunteering my efforts, my time and my computational resources for doing this.
   
   The feature freeze, as announced by @anshumg is only 3 weeks away, and sooner this is merged, better it is for everyone. Not to mention the issues that are blocked on this upgrade..


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "chatman (via GitHub)" <gi...@apache.org>.
chatman commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r2261261170


##########
solr/core/src/java/org/apache/solr/response/transform/ChildDocTransformerFactory.java:
##########
@@ -22,7 +22,7 @@
 import java.io.UncheckedIOException;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.DocValuesFieldExistsQuery;
+import org.apache.lucene.search.FieldExistsQuery;

Review Comment:
   @cpoerschke Thanks for pointing this point, I missed seeing this. Can we open a JIRA for this please, and mark it as a release blocker (10.0)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #3053:
URL: https://github.com/apache/solr/pull/3053#discussion_r1941767347


##########
solr/core/src/java/org/apache/solr/search/Grouping.java:
##########
@@ -603,7 +566,7 @@ protected Integer getNumberOfGroups() {
     protected void populateScoresIfNecessary() throws IOException {
       if (needScores) {
         for (GroupDocs<?> groups : result.groups) {
-          TopFieldCollector.populateScores(groups.scoreDocs, searcher, query);
+          TopFieldCollector.populateScores(groups.scoreDocs(), searcher, query);

Review Comment:
   Just leaving a note here from investigating the grouping-related test failures, the filling in of the scores here does not influence the `maxScore` of a group and that seems to be wrong (always 1 possibly?) and so the groups are ordered wrongly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17631: Upgrade main to Lucene 10.x [solr]

Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy commented on PR #3053:
URL: https://github.com/apache/solr/pull/3053#issuecomment-2676269144

   @chatman review feedback waiting :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org