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-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org