zacharymorn commented on pull request #180:
URL: https://github.com/apache/lucene/pull/180#issuecomment-871155896


   > > If I understanding the above correctly, eventually we would like to also 
have TermVectors to be similar to Fields, and act like the abstraction API for 
term vectors index data and not just an indirection, and Fields should be an 
internal data structure reserved for posting?
   >
   > Yes!
   
   > FYI Years ago Fields was even more prevalent but I reduced it further -- 
https://issues.apache.org/jira/browse/LUCENE-7500 (read the description). TVs 
were noted as the last place where a Lucene user sees them. A class 
"TermVectors" would be the perfect named substitute for Fields for the TV 
use-case.
   
   Thanks for the confirmation, and it definitely makes sense! I feel maybe we 
should rename `TermVectors` and `TermVectorsReader` to something else if we 
want to go in that direction? Maybe something like: 
   
   *TermVectors -> TermVectorsReader*, and it has the following API:
   ```
   public abstract class TermVectorsReader {
     public abstract TermVectors get(int doc) throws IOException;
   }
   ```
   
   *TermVectorsReader -> TermVectorsReaderBase*, and it has the same APIs as 
before:
   ```
   public abstract class TermVectorsReaderBase extends TermVectorsReader 
implements Cloneable, Closeable {
     
     public abstract void checkIntegrity() throws IOException;
   
     @Override
     public abstract TermVectorsReader clone();
   
     public TermVectorsReader getMergeInstance() {
       return this;
     }
   }
   ```
   
   as such, `TermVectors` can have similar APIs as `Fields`, for example:
   
   ```
   public abstract class TermVectors implements Iterable<String> {
     protected TermVectors() {}
   
     @Override
     public abstract Iterator<String> iterator();
   
     public abstract Terms terms(String field) throws IOException;
   
     public abstract int size();
   
     public static final TermVectors[] EMPTY_ARRAY = new TermVectors[0];
   }
   ```
   
   What do you think about these APIs?
   
   In addition, I also feel that given the extra discussion needed, we should 
probably track this in a different issue?
   


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