jpountz opened a new issue, #12142:
URL: https://github.com/apache/lucene/issues/12142

   ### Description
   
   As @rmuir managed to make me look into reducing the amount of guessing we're 
doing in our document API, I think that a requirement for doing it right will 
be to split our index and store document APIs. Currently, `Document` and 
`IndexableField` are trying to cover both, which creates a confusing API.
   
   For the store API, I wonder if we still need a Document abstraction. Maybe 
we could return a simple `List<StoredValue>` and push the work on users to 
convert it into a map if they want to be able to access fields by name. This is 
something that is easy to do with Java streams nowadays.
   
   For the index API, I'd like to model `IndexableField` according to how it's 
getting consumed by `IndexingChain`. Something like:
   
   ```java
   class IndexableField {
   
     // Populates the inverted index, IndexableValue wraps one of a BytesRef or 
a TokenStream
     IndexableValue invertedValue(Analyzer analyzer, TokenStream reuse);
   
     // Populates points
     byte[] pointValue();
   
     // Populates NUMERIC or SORTED_NUMERIC doc values
     long numericDocValue(); 
   
     // Populates BINARY, SORTED or SORTED_SET doc values
     BytesRef docValue();
   
     // Populates stored fields
     StoredValue storedValue();
   
     // Populates byte[] vectors
     byte[] binaryVectorValue();
   
     // Populates float[] vectors
     float[] floatVectorValue();
   
   }
   ```


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