NewStore returns a new instance of the store.
(c StoreConfig)
| 61 | |
| 62 | // NewStore returns a new instance of the store. |
| 63 | func 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. |
| 74 | func (s *Store) CreateIndex(mapping string) error { |