Skip to content

Commit

Permalink
[APPEND][FSTORE-1135] Fix preview embedding in the UI when pk is not …
Browse files Browse the repository at this point in the history
…in the opensearch schema (#1765)

(cherry picked from commit af7a7dec5a7c084f264c03364e70416b32c815e5)
  • Loading branch information
kennethmhc committed Apr 24, 2024
1 parent 0bb019f commit 1a04ed8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ public void batchWrite(Index index, Map<String, String> data) throws VectorDatab
public List<Map<String, Object>> preview(Index index, Set<Field> fields, int n) throws VectorDatabaseException {
List<Map<String, Object>> results = Lists.newArrayList();

// If fields is empty, return no result, otherwise the search query matches any documents which may not
// belong to requested feature group.
if (fields.size() == 0) {
return results;
}

// Create a bool query
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();

Expand Down

0 comments on commit 1a04ed8

Please sign in to comment.