shubhamvishu commented on code in PR #12548:
URL: https://github.com/apache/lucene/pull/12548#discussion_r1357312134


##########
lucene/core/src/java/org/apache/lucene/search/DoubleValuesSource.java:
##########
@@ -172,6 +173,52 @@ public LongValuesSource rewrite(IndexSearcher searcher) 
throws IOException {
     }
   }
 
+  /**
+   * Returns a DoubleValues instance for computing the vector similarity score 
per document against
+   * the byte query vector
+   *
+   * @param ctx the context for which to return the DoubleValues
+   * @param queryVector byte query vector
+   * @param vectorField knn byte field name
+   * @return DoubleValues instance
+   * @throws IOException if an {@link IOException} occurs
+   */
+  public static DoubleValues similarityToQueryVector(

Review Comment:
   Yes I didn't mean to move all the static methods here(sorry for the 
confusion). My idea was along your suggestion, should we also move the private 
static classes that are in this class(a lot in number, example - 
[one](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/DoubleValuesSource.java#L309-L372),
 
[two](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/DoubleValuesSource.java#L396-L556)
 and more) which is bloating this class out into another pkg-private class lets 
say `DoubleValuesSourceUtil` (the only implication being we would make these 
private classes pkg-private which is fine I think?). This way we could only 
keep the required API methods in DVS class and move out the rest stuff making 
this lean and readable. If that makes sense I'll put up these changes too with 
the followup CR(like below). Let me know what do you think?
   
   Here is an short example commit I made to explain what I was saying - 
https://github.com/shubhamvishu/lucene/commit/604f1fdcad96a3c5e09356190645b6f2ec16bb2c



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