Generating vectors in Elasticsearch
Vectors can be generated during ingest before a document is indexed (written) into Elasticsearch using an ingest pipeline. Each processor in the ingest pipeline performs a different task, such as enriching, modifying, or removing data. The key processor in that pipeline is the inference processor, which passes the text to an embedding model, receives the vector representation, and then adds the vector to the original document payload before moving it along to be stored in an index. This ensures that the document’s vector representation is available for indexing and searching immediately after it is ingested.
Coming up is an example of an Elasticsearch ingest pipeline configuration that uses the inference processor with the sentence-transformers/msmarco-MiniLM-L-12-v3 model we loaded earlier. The pipeline takes a field named summary
from the input document, processes it using the embedding model to generate an embedding, and stores the resulting...