Vector Search
Vector search uses vector values generated by an embedding model.
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 VectorType fields in the Content component.
After you index vectors in your documents in Content, you can query for them by using the VECTOR operator in the Query action. You provide the query text as vectors in this operator, and Content finds vectors that are close to it, by a configurable distance metric.
You can use any valid model to generate embeddings, but you must use the same model to generate the embeddings at index time and at query time. For
Generate Vectors
You can generate vectors by using Query Manipulation Server (QMS). You configure QMS with the details of the models that you want to use to generate the embeddings, and use the ModelEncode action to generate the embeddings.
At index time, you can use QMS to generate the embeddings and add them to a VectorType document field before you index it into Content. A single document can have multiple instances of a vector field, or multiple different vector fields (for example, using different embedding models).
At query time, you can use QMS to convert the query text into embeddings, and use them in a VECTOR query to Content. You can either use the ModelEncode action to convert text into vectors to use in the query, or you can send text to QMS in a Query action with the QueryType parameter set to enable vector search, in which case QMS automatically converts the text and sends the VECTOR query.
For more information, refer to the Query Manipulation Server Help.
In addition to using QMS, you can:
-
generate vectors during the ingest process by using the NiFi Ingest Document Embeddings processor. For more information, refer to the NiFi Ingest Help.
-
generate image embeddings, which you can index and search for, by using Media Server. For more information, refer to the Media Server Help.
Vector Results
When you run a vector search, Content uses a configured method to compare the vector in your search with the indexed values, and returns the most similar ones.
To get more specific results, you can configure QMS and NiFi Ingest to automatically chunk up the input text into multiple vectors, which might overlap. QMS and NiFi Ingest then include offset information, so that Content can retrieve the part of the document that the vector represents.