Skip to content

Commit

Permalink
Refine code (#989)
Browse files Browse the repository at this point in the history
Signed-off-by: yhmo <yihua.mo@zilliz.com>
  • Loading branch information
yhmo authored Jul 11, 2024
1 parent b8a8230 commit 010438c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/main/java/io/milvus/v1/HybridSearchExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private void hybridSearch() {
SearchResultsWrapper results = new SearchResultsWrapper(searchR.getData().getResults());
for (int k = 0; k < NQ; k++) {
System.out.printf("============= Search result of No.%d vector =============\n", k);
List<SearchResultsWrapper.IDScore> scores = results.getIDScore(0);
List<SearchResultsWrapper.IDScore> scores = results.getIDScore(k);
for (SearchResultsWrapper.IDScore score : scores) {
System.out.println(score);
}
Expand Down
7 changes: 6 additions & 1 deletion examples/main/java/io/milvus/v1/SimpleExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public static void main(String[] args) {
.withFloatVectors(Arrays.asList(vector))
.withVectorFieldName(VECTOR_FIELD)
.withParams("{}")
.addOutField(VECTOR_FIELD)
.addOutField(TITLE_FIELD)
.build());
if (searchRet.getStatus() != R.Status.Success.getCode()) {
Expand All @@ -155,7 +156,11 @@ public static void main(String[] args) {
List<SearchResultsWrapper.IDScore> scores = resultsWrapper.getIDScore(0);
System.out.println("The result of No.0 target vector:");
for (SearchResultsWrapper.IDScore score:scores) {
System.out.println(score);
List<Float> vectorReturned = (List<Float>)score.get(VECTOR_FIELD);
System.out.println(vectorReturned);

String title = (String)score.get(TITLE_FIELD);
System.out.println(title);
}

// drop the collection if you don't need the collection anymore
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<okhttp.version>4.12.0</okhttp.version>
<plexus.version>3.0.24</plexus.version>
<maven.source.plugin.version>3.1.0</maven.source.plugin.version>
<maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
<maven.javadoc.plugin.version>3.7.0</maven.javadoc.plugin.version>
<os.maven.plugin.version>1.6.2</os.maven.plugin.version>
<maven.release.plugin.version>2.5.3</maven.release.plugin.version>
<protobuf.maven.plugin.version>0.6.1</protobuf.maven.plugin.version>
Expand Down Expand Up @@ -407,7 +407,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
<javadocExecutable>/usr/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/milvus/response/QueryResultsWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public List<QueryResultsWrapper.RowRecord> getRowRecords() {
* Gets a row record from result.
* Throws {@link ParamException} if the index is illegal.
*
* @param
* @param index index of a row
* @return <code>RowRecord</code> a row record of the result
*/
protected QueryResultsWrapper.RowRecord buildRowRecord(long index) {
Expand Down

0 comments on commit 010438c

Please sign in to comment.