Documentation ¶
Index ¶
- type ESOption
- type ElasticsearchVectorStore
- func (ES *ElasticsearchVectorStore) AddDocuments(ctx context.Context, indexName string, documents []document.Document) (batchErr []error, err error)
- func (ES *ElasticsearchVectorStore) AddText(ctx context.Context, indexName string, input string) (err error)
- func (ES *ElasticsearchVectorStore) DeleteIndex(ctx context.Context, indexName string) (err error)
- func (ES *ElasticsearchVectorStore) Search(ctx context.Context, indexName string, query string, ...) (docs []document.Document, err error)
- func (ES *ElasticsearchVectorStore) SearchVector(ctx context.Context, indexName string, vector []float32, ...) (docs []document.Document, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElasticsearchVectorStore ¶
type ElasticsearchVectorStore struct {
// contains filtered or unexported fields
}
ElasticsearchVectorStore provide access to elasticsearch
func NewElasticsearchVectorStore ¶
func NewElasticsearchVectorStore(host string, embeddingModel model.EmbeddingModel, esOption ...func(*ESOption)) (EVS *ElasticsearchVectorStore, err error)
NewElasticsearchVectorStore return new Elasticsearch instance
func (*ElasticsearchVectorStore) AddDocuments ¶
func (ES *ElasticsearchVectorStore) AddDocuments(ctx context.Context, indexName string, documents []document.Document) (batchErr []error, err error)
AddDocuments store a batch of documents to vector index it will also store embedding of the document using specified embedding model If the index doesnt exist, it will create one with default schema
func (*ElasticsearchVectorStore) AddText ¶
func (ES *ElasticsearchVectorStore) AddText(ctx context.Context, indexName string, input string) (err error)
AddText store text to vector index it will also store embedding of the text using specified embedding model If the index doesnt exist, it will create one with default schema
func (*ElasticsearchVectorStore) DeleteIndex ¶
func (ES *ElasticsearchVectorStore) DeleteIndex(ctx context.Context, indexName string) (err error)
DeleteIndex drop the index
Click to show internal directories.
Click to hide internal directories.