We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SearchParam searchParam = SearchParam.create(collectionName) .setDsl(dsl) .setParamsInJson("{"fields": ["duration", "release_year", "embedding"]}"); System.out.println("\n--------Search Result--------"); SearchResult searchResult = client.search(searchParam);
private SearchResult buildSearchResponse(QueryResult topKQueryResult) { final int numQueries = (int) topKQueryResult.getRowNum(); final int topK = numQueries == 0 ? 0 : topKQueryResult.getDistancesCount() / numQueries;
List<List<Long>> resultIdsList = new ArrayList<>(numQueries); List<List<Float>> resultDistancesList = new ArrayList<>(numQueries); List<List<Map<String, Object>>> resultFieldsMap = new ArrayList<>(numQueries); Entities entities = topKQueryResult.getEntities(); List<Long> queryIdsList = entities.getIdsList(); List<Float> queryDistancesList = topKQueryResult.getDistancesList(); // If fields specified, put it into searchResponse List<Map<String, Object>> fieldsMap = new ArrayList<>(); for (int i = 0; i < queryIdsList.size(); i++) { fieldsMap.add(new HashMap<>()); } if (entities.getValidRowCount() != 0) { List<FieldValue> fieldValueList = entities.getFieldsList(); for (FieldValue fieldValue : fieldValueList) { String fieldName = fieldValue.getFieldName(); for (int j = 0; j < queryIdsList.size(); j++) { if (fieldValue.getAttrRecord().getInt32ValueCount() > 0) { fieldsMap.get(j).put(fieldName, fieldValue.getAttrRecord().getInt32ValueList().get(j)); } else if (fieldValue.getAttrRecord().getInt64ValueCount() > 0) { fieldsMap.get(j).put(fieldName, fieldValue.getAttrRecord().getInt64ValueList().get(j)); } else if (fieldValue.getAttrRecord().getDoubleValueCount() > 0) { fieldsMap.get(j).put(fieldName, fieldValue.getAttrRecord().getDoubleValueList().get(j)); } else if (fieldValue.getAttrRecord().getFloatValueCount() > 0) { fieldsMap.get(j).put(fieldName, fieldValue.getAttrRecord().getFloatValueList().get(j)); } else { // the object is vector List<VectorRowRecord> vectorRowRecordList = fieldValue.getVectorRecord().getRecordsList(); if (vectorRowRecordList.get(j).getFloatDataCount() > 0) { fieldsMap.get(j).put(fieldName, vectorRowRecordList.get(j).getFloatDataList()); } else { fieldsMap.get(j).put(fieldName, vectorRowRecordList.get(j).getBinaryData().asReadOnlyByteBuffer()); } } } } }
.... }
进入search方法后, 在buildSearchResponse () 里, j 循环报错 Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
The text was updated successfully, but these errors were encountered:
Which SDK version are you using?
v0.9.1 fixed a bug related to this: milvus-io/milvus#4086
Sorry, something went wrong.
No branches or pull requests
SearchParam searchParam =
SearchParam.create(collectionName)
.setDsl(dsl)
.setParamsInJson("{"fields": ["duration", "release_year", "embedding"]}");
System.out.println("\n--------Search Result--------");
SearchResult searchResult = client.search(searchParam);
private SearchResult buildSearchResponse(QueryResult topKQueryResult) {
final int numQueries = (int) topKQueryResult.getRowNum();
final int topK = numQueries == 0 ? 0 : topKQueryResult.getDistancesCount() / numQueries;
....
}
进入search方法后, 在buildSearchResponse () 里, j 循环报错
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
The text was updated successfully, but these errors were encountered: