[GitHub] [lucene-solr] jpountz commented on a change in pull request #797: LUCENE-8921: IndexSearcher.termStatistics requires docFreq totalTermFreq instead of TermStates

2019-09-04 Thread GitBox
jpountz commented on a change in pull request #797: LUCENE-8921: 
IndexSearcher.termStatistics requires docFreq totalTermFreq instead of 
TermStates
URL: https://github.com/apache/lucene-solr/pull/797#discussion_r320717177
 
 

 ##
 File path: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
 ##
 @@ -861,17 +861,17 @@ public String toString() {
   
   /**
* Returns {@link TermStatistics} for a term, or {@code null} if
-   * the term does not exist.
+   * the term does not exist (if docFreq == 0).
* 
* This can be overridden for example, to return a term's statistics
* across a distributed collection.
* @lucene.experimental
*/
-  public TermStatistics termStatistics(Term term, TermStates context) throws 
IOException {
-if (context.docFreq() == 0) {
+  public TermStatistics termStatistics(Term term, int docFreq, long 
totalTermFreq) throws IOException {
+if (docFreq == 0) {
 
 Review comment:
   +1 to your idea of deprecating + marking final and introducing the new API


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] jpountz commented on a change in pull request #797: LUCENE-8921: IndexSearcher.termStatistics requires docFreq totalTermFreq instead of TermStates

2019-09-04 Thread GitBox
jpountz commented on a change in pull request #797: LUCENE-8921: 
IndexSearcher.termStatistics requires docFreq totalTermFreq instead of 
TermStates
URL: https://github.com/apache/lucene-solr/pull/797#discussion_r320612366
 
 

 ##
 File path: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
 ##
 @@ -861,17 +861,17 @@ public String toString() {
   
   /**
* Returns {@link TermStatistics} for a term, or {@code null} if
-   * the term does not exist.
+   * the term does not exist (if docFreq == 0).
* 
* This can be overridden for example, to return a term's statistics
* across a distributed collection.
* @lucene.experimental
*/
-  public TermStatistics termStatistics(Term term, TermStates context) throws 
IOException {
-if (context.docFreq() == 0) {
+  public TermStatistics termStatistics(Term term, int docFreq, long 
totalTermFreq) throws IOException {
+if (docFreq == 0) {
 
 Review comment:
   That works for me, but then let's only merge this to master? My concern is 
that this IndexSearcher method might not only be used internally but also by 
Lucene users.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] jpountz commented on a change in pull request #797: LUCENE-8921: IndexSearcher.termStatistics requires docFreq totalTermFreq instead of TermStates

2019-07-26 Thread GitBox
jpountz commented on a change in pull request #797: LUCENE-8921: 
IndexSearcher.termStatistics requires docFreq totalTermFreq instead of 
TermStates
URL: https://github.com/apache/lucene-solr/pull/797#discussion_r307667928
 
 

 ##
 File path: lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
 ##
 @@ -861,17 +861,17 @@ public String toString() {
   
   /**
* Returns {@link TermStatistics} for a term, or {@code null} if
-   * the term does not exist.
+   * the term does not exist (if docFreq == 0).
* 
* This can be overridden for example, to return a term's statistics
* across a distributed collection.
* @lucene.experimental
*/
-  public TermStatistics termStatistics(Term term, TermStates context) throws 
IOException {
-if (context.docFreq() == 0) {
+  public TermStatistics termStatistics(Term term, int docFreq, long 
totalTermFreq) throws IOException {
+if (docFreq == 0) {
 
 Review comment:
   Maybe we should do it in two steps, first change the signature and keep the 
docFreq==0 check, this could probably go in 8.x, and then reject calls when 
docFreq==0, which we might only want to push to 9.0?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org