From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Search vector fields

Search vector fields

We saw some examples of scalar queries in the previous video. Now, let's execute vector search. As discussed earlier, for doing vector search, we need to convert the search string also to a vector before it can be compared using the same distance measure as the index. First, we define the search parameters for the search. This is set as L2. This should be of the same metric type that was used to build the index on the vector field. An index is a prerequisite for the vector field before it can be used for semantic search. We set the offset to zero. This means the results are returned from the first scene match for the input query. Offsets can be used for pagination purposes. Ignore_growing is a Boolean parameter. Milvus internally processes data in segments. The parameter is whether the search should ignore segments that are not fully populated. If set to true, the search may ignore some newly added data. Setting it to false would also include all new data at an additional query cost…

Contents