Skip to content

Commit afd8d59

Browse files
committed
update with HDC
1 parent 3b398de commit afd8d59

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/src/main/java/QuickStartHCD.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ public static void main(String[] args) {
3636

3737
// Build a token in the form of Cassandra:base64(username):base64(password)
3838
String token = new UsernamePasswordTokenProvider(cassandraUserName, cassandraPassword).getToken();
39-
System.out.println("01/12 - Creating Token: " + token);
39+
System.out.println("1/7 - Creating Token: " + token);
4040

4141
// Initialize the client
4242
DataAPIClient client = new DataAPIClient(token, builder().withDestination(HCD).build());
43-
System.out.println("02/12 -Connected to Data API");
43+
System.out.println("2/7 - Connected to Data API");
4444

4545
// Create a default keyspace
4646
((DataAPIDatabaseAdmin) client
4747
.getDatabase(dataApiUrl)
4848
.getDatabaseAdmin()).createNamespace(keyspaceName, NamespaceOptions.simpleStrategy(1));
49-
System.out.println("03/12 -Keyspace '" + keyspaceName + "'created ");
49+
System.out.println("3/7 - Keyspace '" + keyspaceName + "'created ");
5050

5151
Database db = client.getDatabase(dataApiUrl, keyspaceName);
52-
System.out.println("04/12 -Connected to Database");
52+
System.out.println("4/7 - Connected to Database");
5353

5454
// Create a collection with Vector embeddings OPEN AI
5555
Collection<Document> collectionLyrics = db.createCollection(collectionName, CollectionOptions.builder()
@@ -58,7 +58,7 @@ public static void main(String[] args) {
5858
.vectorize(openAiProvider, openAiModel)
5959
.build(),
6060
new CommandOptions<>().embeddingAPIKey(openAiKey));
61-
System.out.println("05/12 -Collection created with OpenAI embeddings");
61+
System.out.println("5/7 - Collection created with OpenAI embeddings");
6262

6363
// Insert some documents
6464
collectionLyrics.insertMany(
@@ -69,15 +69,15 @@ public static void main(String[] args) {
6969
new Document(6).append("band", "Dire Straits").append("song", "Romeo And Juliet").vectorize("She's singing, Hey la, my boyfriend's back"),
7070
new Document(7).append("band", "Dire Straits").append("song", "Romeo And Juliet").vectorize("You shouldn't come around here singing up at people like that"),
7171
new Document(8).append("band", "Dire Straits").append("song", "Romeo And Juliet").vectorize("Anyway, what you gonna do about it?"));
72-
System.out.println("06/12 -Collection populated");
72+
System.out.println("6/7 - Collection populated");
7373

7474
// Find one document
7575
Optional<Document> doc = collectionLyrics.findOne(
7676
eq("band", "Dire Straits"),
7777
new FindOneOptions()
7878
.sort("You shouldn't come around here singing up at people like tha")
7979
.includeSimilarity());
80-
System.out.println("07/12 -Found document: " + doc);
80+
System.out.println("7/7 - Found document: " + doc);
8181
}
8282

8383
}

0 commit comments

Comments
 (0)