MCPcopy
hub / github.com/elastic/go-elasticsearch / NewStore

Function NewStore

_examples/xkcdsearch/store.go:63–71  ·  view source on GitHub ↗

NewStore returns a new instance of the store.

(c StoreConfig)

Source from the content-addressed store, hash-verified

61
62// NewStore returns a new instance of the store.
63func NewStore(c StoreConfig) (*Store, error) {
64 indexName := c.IndexName
65 if indexName == "" {
66 indexName = "xkcd"
67 }
68
69 s := Store{es: c.Client, indexName: indexName}
70 return &s, nil
71}
72
73// CreateIndex creates a new index with mapping.
74func (s *Store) CreateIndex(mapping string) error {

Callers 4

TestStoreFunction · 0.92
index.goFile · 0.92
server.goFile · 0.92
search.goFile · 0.92

Calls

no outgoing calls

Tested by 1

TestStoreFunction · 0.74