P3_102 Queries 1 (Python)
This course was written for the Weaviate Python client API (v3
), and is now deprecated.
If you are new to Weaviate, we recommend you start with one of the 100-level courses written with the v4
client API, such as those for working with text data, your own vectors, or multimodal data.
Unit overview
In this unit, you will learn how to efficiently retrieve relevant objects or aggregated information from Weaviate.
You have already encountered some examples of vector searches. In this section, we will delve deeper by reviewing the various vector search methods available in Weaviate, such as nearVector
, nearObject
, and nearText
.
Along with vector search methods, you will also discover filters that can be employed to accompany search operators. For instance, you will learn how to search for data objects that exclude specific criteria.
As we examine these capabilities, we will simultaneously use them as a means to gain insight into the inner workings of Weaviate.
Upon completing this unit, you will possess a thorough understanding of how to effectively query Weaviate to obtain desired results, as well as the underlying mechanisms that make it all possible.
Prerequisites
- (Required) A Python (3) environment with
weaviate-client
installed. - (Required) Complete 101A Weaviate Academy Preparation
- (Recommended) Complete Hello, Weaviate
Learning objectives
What are these?
- Learning Goals describe the unit's key topics and ideas.
- Learning Outcomes on the other hand describe tangible skills that the learner should be able to demonstrate
Here, we will cover:
Learning Goals- How to retrieve objects and properties.
- The structure of returned responses from Weaviate.
- The difference between `nearVector`, `nearObject` and `nearText`.
- How to aggregate meta information about objects.
- How to add filters to vector searches.
- Weaviate's internal vector search process.
By the time you are finished, you will be able to:
Learning Outcomes- Construct 'Get' queries to retrieve relevant objects and desired properties.
- Parse a response from Weaviate.
- Explain the differences between `nearVector`, `nearObject` and `nearText`.
- Construct 'Aggregate' queries to retrieve aggregated properties about relevant objects.
- Add filters to queries to exclude certain results.
- Describe how `nearObject` and `nearText` queries are converted to vector searches, and what pre-filtering is.
Questions and feedback
If you have any questions or feedback, let us know in the user forum.