Vector Search

A vector query returns documents that contain an indexed vector that is similar to a vector that you provide.

A vector is an array of numbers that represents an object, which might be text or an image. You can generate vectors by using many different models, and index them into IDOL in VectorType fields.

The Query action VECTOR operator allows you to search for vectors in your documents that are similar to the vector that you provide.

The syntax for the VECTOR operator is:

text=VECTOR{v1,v2,...,vn:maxdist}[:maxneighbors]:fieldname

where,

v1,v2,...,vn

is the comma-separated list of values that makes up the vector for which you want to find similar vectors.

The vector that you provide must be from the same model, and have the same number of dimensions, as the vectors that you use in your index.

maxdist

(optional) is the maximum distance from the search vector that you want to find. IDOL calculates this distance according to the value you set for DistanceMetric, which you set according to the requirements of your vector model.

The default value is positive infinity (that is, there is no maximum distance). When DistanceMetric is set to L2 or Cosine, you can also use any negative number to mean there is no maximum distance.

maxneighbors

(optional) is the maximum number of similar vectors to return in the results.
fieldname is the name of the field in your indexed documents that contains the vectors that you want to search.

For a vector search, IDOL Content Component returns the documents where the specified field contains the closest vectors to the vector that you provide, according to the DistanceMetric. If a document contains more than one instance of the vector field, IDOL Content Component uses the closest one to the search vector.

Highlight Values in Vector Search

When you use the Highlight parameter with a VECTOR query, IDOL Content Component highlights the appropriate section of the source text for the vector, as long as you print the source field in the query results.

Vector highlighting works for all highlight options. For example, with Sentences highlighting, IDOL Server highlights all sentences that overlap with the vector source text.

For Terms highlighting, Content highlights only entire words, even if the vector offset is in the middle of a word.

NOTE: Proximity highlighting is the same as terms highlighting, as there is no defined proximity between vector and non-vector fields.