Documentation ¶
Index ¶
- type ESOption
- type ElasticHit
- type ElasticResponse
- 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)
- type KNNField
- type KNNSearchBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElasticHit ¶
type ElasticHit struct { Index string `json:"_index,omitempty"` ID string `json:"_id,omitempty"` Score float64 `json:"_score,omitempty"` Source_ json.RawMessage `json:"_source,omitempty"` }
type ElasticResponse ¶
type ElasticResponse struct { Took int `json:"took,omitempty"` TimedOut bool `json:"timed_out,omitempty"` Hits struct { MaxScore float64 `json:"max_score,omitempty"` Hits []ElasticHit `json:"hits,omitempty"` } `json:"hits,omitempty"` }
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
type KNNSearchBody ¶
Click to show internal directories.
Click to hide internal directories.