Documentation ¶
Index ¶
- func BuildResults(recipes []elastigo.Hit) []models.Recipe
- func SetIndex(i string)
- type Connection
- func (c *Connection) Create(r models.Recipe) (elastigo.BaseResponse, error)
- func (c *Connection) Delete(id string) (elastigo.BaseResponse, error)
- func (c *Connection) DeleteIndex() (elastigo.BaseResponse, error)
- func (c *Connection) GetById(id string) (*models.Recipe, error)
- func (c *Connection) Query(s string) ([]models.Recipe, error)
- func (c *Connection) Show() ([]models.Recipe, error)
- func (c *Connection) Update(id string, r models.Recipe) (elastigo.BaseResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResults ¶
BuildResults loop through the hits based on the total hits
Types ¶
type Connection ¶
func NewConnection ¶
func NewConnection() (*Connection, error)
NewConnection create a new Elastic Search connection
func (*Connection) Create ¶
func (c *Connection) Create(r models.Recipe) (elastigo.BaseResponse, error)
Create a new doc
func (*Connection) Delete ¶
func (c *Connection) Delete(id string) (elastigo.BaseResponse, error)
Delete a doc from the index
func (*Connection) DeleteIndex ¶
func (c *Connection) DeleteIndex() (elastigo.BaseResponse, error)
DeleteIndex alll docs from the index
func (*Connection) GetById ¶
func (c *Connection) GetById(id string) (*models.Recipe, error)
GetById show the doc by id
func (*Connection) Query ¶
func (c *Connection) Query(s string) ([]models.Recipe, error)
Query the index and match the search term
func (*Connection) Show ¶
func (c *Connection) Show() ([]models.Recipe, error)
Show all the docs in the index
func (*Connection) Update ¶
func (c *Connection) Update(id string, r models.Recipe) (elastigo.BaseResponse, error)
Update a doc by id
Click to show internal directories.
Click to hide internal directories.