iamsanjay opened a new pull request, #13319: URL: https://github.com/apache/lucene/pull/13319
### Description <!-- If this is your first contribution to Lucene, please make sure you have reviewed the contribution guide. https://github.com/apache/lucene/blob/main/CONTRIBUTING.md --> #13180 This PR would declare the scoreSupplier method abstract and marked scorer final. The nature of the change itself is not complex, however the large number of files has been modified with this change. **Few Observations:** 1. As this change would enforce subclasses of Weight to implement scorerSupplier, the default cost calculation method is used where it was missing ``` @Override public long cost() { return scorer.iterator().cost(); } ``` 2. scorer method is removed from SpanQuery.java and therefore all the classes has to implement the scorerSupplier, We can also move the socrerSupplier method to SpanQuery that way the subclasses does not has to provide the implementation, which is same for all subclasses. 3. scorer method removed from AssertingWeight. 4. What would be the implementation for cost where calling scorer throws UnsupportedOpeartionException. Does cost method also throws the same exception, currently it's returning 0. Below are the classes where you will find such code. ``` lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java is also such example. lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java lucene/core/src/test/org/apache/lucene/search/TestDisiPriorityQueue.java lucene/core/src/test/org/apache/lucene/search/TestDisjunctionScoreBlockBoundaryPropagator.java lucene/core/src/test/org/apache/lucene/search/TestMaxScoreBulkScorer.java lucene/facet/src/java/org/apache/lucene/facet/DrillSidewaysQuery.java lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionWeight.java ``` -- 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...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org