Skip to content

Commit 1daf15c

Browse files
committed
FindAndRerank
1 parent 9548ffc commit 1daf15c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

examples/src/main/java/com/datastax/astra/docs/UpdateOneExample2.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import static com.datastax.astra.client.core.query.Projection.include;
3232
import static com.datastax.astra.client.tables.commands.options.CreateIndexOptions.IF_NOT_EXISTS;
33+
import static com.datastax.astra.internal.serdes.tables.RowMapper.mapAsRow;
3334

3435
public class UpdateOneExample2 {
3536

@@ -60,18 +61,13 @@ public static void main(String[] args) throws Exception {
6061
* But here we need to override 'summaryGenresVector' with
6162
* a String to use the "Vectorize" feature of Astra.
6263
*/
63-
List<Row> rows = books.stream().map(book -> {
64-
Row row = RowMapper.mapAsRow(book);
65-
// Override 'summaryGenresVector' with a String
66-
row.put("summaryGenresVector", String.format(
64+
List<Row> rows = books.stream().map(book ->
65+
mapAsRow(book).put("summaryGenresVector", String.format(
6766
"summary: %s | genres: %s", book.getSummary(),
68-
String.join(", ", book.getGenres())));
69-
return row;
70-
}).toList();
67+
String.join(", ", book.getGenres())))).toList();
7168
database.getTable("quickstart_table").insertMany(rows);
7269

73-
74-
// Next Seach Table
70+
// Next Search Table
7571

7672
}
7773

0 commit comments

Comments
 (0)