[ https://issues.apache.org/jira/browse/LUCENE-10398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17492755#comment-17492755 ]
Greg Miller commented on LUCENE-10398: -------------------------------------- Ok great [~spike.liu]! As I thought about this more, I'm not quite as enthusiastic about adding this, but could still be convinced it's a good thing to do :) . It seems quite common that users will want to directly access doc values for various reasons, and providing nice ways to load them (i.e., the static factory methods in {{{}DocValues{}}}) is nice. On the other hand, I'm not sure how common it really is for users to directly load {{Terms}} for a given field. Before adding this functionality, I think it would be nice to have some concrete uses for it inside of the Lucene code base. Could we look for some places where this sort of factory method would be useful to better motivate the need? Or maybe we have some common user needs we're convinced of? > Add static method for getting Terms from LeafReader > --------------------------------------------------- > > Key: LUCENE-10398 > URL: https://issues.apache.org/jira/browse/LUCENE-10398 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Marc D'Mello > Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Hi all, {{LeafReader}} has methods like {{getBinaryDocValues(String field)}} > that return {{null}} values if the field is not indexed. These methods also > have equivalent {{DocValues}} static methods, such as > {{DocValues.getBinary()}}, which return an {{emptyBinary()}} rather than a > {{null}} if there is no field. I noticed that {{Terms}} does not have an > equivalent static method for {{LeafReader.terms()}} like {{Terms.terms()}} or > something similar. I was wondering if there was a reason for this, or if a > method like this could be useful. Thanks! -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org