Skip to main content

P3_102 Queries 1 (Python)

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.


Learning objectives

  What are these?
  Each unit includes a set of Learning Goals and Learning Outcomes which form the unit's guiding principles.
  • 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, please let us know on our forum. For example, you can: