Ignacio Vera created LUCENE-10161:
-------------------------------------

             Summary: Points implementation should distinguish between indexed 
and not indexed PointValues
                 Key: LUCENE-10161
                 URL: https://issues.apache.org/jira/browse/LUCENE-10161
             Project: Lucene - Core
          Issue Type: Improvement
            Reporter: Ignacio Vera


While working in L|UCENE-9820, where we are trying to add a cursor like API to 
PointValues API, I had a lot of friction with MutablePointValues. The issue is 
that this interface is representing non-indexed points but it is extending 
PointValues that describes indexed points.

Therefore here is proposed to extract a minimal interface from PointValues that 
represents not-indexed points. There idea would be something like:

 
{code:java}
/**
 * Access to numeric values.
 *
 * @lucene.experimental
 */
public interface PointValuesReader {

  /**
   * Provides access to the points in this reader.
   *
   * @lucene.experimental
   */
  @FunctionalInterface
  interface DocValueVisitor {
    /**
     * Called for all documents in the reader when called in {@link
     * #visitDocValues(DocValueVisitor)}.
     */
    void visit(int docID, byte[] packedValue) throws IOException;
  }

  /** Visit all doc and values in this reader */
  void visitDocValues(DocValueVisitor visitor) throws IOException;

  /** Returns the total number of points in this reader. */
  long size();
} {code}
 

This interface should be implemented by MutablePointValues and PointValues and 
should simplify the current implementation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to