Leomrlin commented on code in PR #749:
URL: https://github.com/apache/geaflow/pull/749#discussion_r2870239861


##########
geaflow/geaflow-plugins/geaflow-store/geaflow-store-vector/src/main/java/org/apache/geaflow/store/lucene/GraphVectorIndex.java:
##########
@@ -142,12 +142,12 @@ public K searchVectorIndex(boolean isVertex, String 
fieldName, float[] vector, i
             IndexSearcher searcher = new IndexSearcher(reader);
 
             // Create KNN vector query
-            KnnVectorQuery knnQuery = new KnnVectorQuery(fieldName, vector, 
topK);
+            KnnFloatVectorQuery knnQuery = new KnnFloatVectorQuery(fieldName, 
vector, topK);
 
             // Execute search
             TopDocs topDocs = searcher.search(knnQuery, topK);
 
-            Document firstDoc = searcher.doc(topDocs.scoreDocs[0].doc);
+            Document firstDoc = 
searcher.storedFields().document(topDocs.scoreDocs[0].doc);

Review Comment:
   What are the version requirements for `Lucene` regarding the 
`storedFields()` method? Does this change affect performance (by adding an 
extra method call)?



##########
geaflow/geaflow-plugins/geaflow-store/geaflow-store-rocksdb/src/main/java/org/apache/geaflow/store/rocksdb/RocksdbClient.java:
##########
@@ -88,7 +88,7 @@ private void initRocksDbOptions() {
         if (this.rocksDBOptions == null || this.rocksDBOptions.isClosed()) {
             LOGGER.info("rocksdb optionClass {}", optionClass);
             try {
-                this.rocksDBOptions = (IRocksDBOptions) 
Class.forName(optionClass).newInstance();
+                this.rocksDBOptions = (IRocksDBOptions) 
Class.forName(optionClass).getDeclaredConstructor().newInstance();

Review Comment:
   Do all implementation classes of `optionClass` have a no-argument 
constructor? 
   If some classes do not have a no-argument constructor, will 
`getDeclaredConstructor()` throw an exception?



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

Reply via email to