From the course: Vector Databases in Practice: Deep Dive
Challenge: Add another object collection
(upbeat music) - [Instructor] We are going to extend the database that you created earlier to add another collection called Synopsis. This will separately store the synopsis for each movie, which can be thought of as a summary of key ideas for each movie. So in contrast to the movie collection, whose vectors are based on the title and the brief description, the synopsis collection will allow searching by the vector of this slightly richer, fuller idea of each movie. Start by extending the collection definition in this file. As before, we provide an outline that you can start it from. The synopsis collection can have a similar structure to what you've seen before, for example, the review collection. It just needs the one property called body and the reference property for movie that'll point to the movie collection. And then we'll add another reference property to the movie collection so that for each movie you can find the corresponding synopsis as well. Take a note of this hint that says you can use the movies.config.add.reference method to create the references. I'll note that we haven't tackled this exact task before of adding references after a collection's been created. So if you get stuck, take a look at these hints and also take a look at the docstrings for any functions or methods you're not sure about. The docstrings will provide you with the help and guidance for how to use these particular functions. As a bonus task, you can also attempt to import the synopsis data by extending this import file. Once again, the structure for these imports will be very similar to what you've seen before with the other collections. The main difference will come from the fact that you're now working with different collections, which will have different property names and column names, but generally speaking, the overall process of looping over objects and then importing them in sets don't necessarily change. Once again, another difference might be adding references from these movies to synopsis. Take a look at these hints and the associated docstrings for these methods if you need any further guidance. Good luck and have fun.
Contents
-
-
-
-
Create your own database3m 33s
-
Work with Weaviate3m 11s
-
Create an object collection3m 39s
-
Basic data import in Weaviate3m 51s
-
Establishing relationships with references4m 25s
-
Recap: Building a vector database2m 40s
-
Challenge: Add another object collection2m 14s
-
Solution: Add another object collection5m 4s
-
-
-
-