benwtrent commented on code in PR #13990:
URL: https://github.com/apache/lucene/pull/13990#discussion_r1838141983
##########
lucene/core/src/test/org/apache/lucene/search/TestKnnFloatVectorQuery.java:
##########
@@ -29,13 +29,7 @@
import org.apache.lucene.document.Field;
import org.apache.lucene.document.KnnFloatVectorField;
import org.apache.lucene.document.StringField;
-import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.QueryTimeout;
-import org.apache.lucene.index.VectorSimilarityFunction;
+import org.apache.lucene.index.*;
Review Comment:
Let's not collapse to `*`
##########
lucene/core/src/java/org/apache/lucene/search/KnnFloatVectorQuery.java:
##########
@@ -112,7 +112,14 @@ VectorScorer createVectorScorer(LeafReaderContext context,
FieldInfo fi) throws
@Override
public String toString(String field) {
- return getClass().getSimpleName() + ":" + this.field + "[" + target[0] +
",...][" + k + "]";
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(getClass().getSimpleName() + ":");
+ buffer.append(this.field + "[" + target[0] + ",...]");
+ buffer.append("[" + k + "]");
+ if (this.filter != null) {
+ buffer.append(",filter:[" + this.filter + "]");
+ }
Review Comment:
```suggestion
if (this.filter != null) {
buffer.append("[" + this.filter + "]");
}
```
I think that would be better.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]