gf2121 commented on code in PR #14716:
URL: https://github.com/apache/lucene/pull/14716#discussion_r2114174953


##########
lucene/core/src/java/org/apache/lucene/index/TermsEnum.java:
##########
@@ -170,11 +170,15 @@ public final PostingsEnum postings(PostingsEnum reuse) 
throws IOException {
   public abstract PostingsEnum postings(PostingsEnum reuse, int flags) throws 
IOException;
 
   /**
-   * Return a {@link ImpactsEnum}.
+   * Return a {@link PostingsEnum} that exposes impacts.
    *
    * @see #postings(PostingsEnum, int)
+   * @deprecated Use {@link #postings(PostingsEnum)} with {@link 
PostingsEnum#IMPACTS}
    */
-  public abstract ImpactsEnum impacts(int flags) throws IOException;
+  @Deprecated

Review Comment:
   Should we remove this and deprecate in 10x?



##########
lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java:
##########
@@ -63,6 +87,12 @@ public abstract class PostingsEnum extends DocIdSetIterator {
    */
   public static final short ALL = OFFSETS | PAYLOADS;
 
+  /**
+   * Flag to pass to {@link TermsEnum#postings(PostingsEnum, int)} to get 
impacts in the returned
+   * enum.
+   */
+  public static final short IMPACTS = FREQS | 1 << 7;

Review Comment:
   Just wild thought: can we make impacts work on `PostingEnum.FREQ` instead 
introducing this flag?  We can delay the reading of impact bytes (where is 
`needsImpacts` mostly used today)  to `getImpacts`, so that it won't cause any 
noticeable overhead.



-- 
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

Reply via email to