Documentation
¶
Index ¶
- Constants
- Variables
- func NewConfigSimple(addrURL, username, password string, tlsInsecureSkipVerify bool) elasticsearch.Config
- func NewSimpleClient(serverURL, username, password string, allowInsecure bool) (httpsimple.Client, error)
- type Client
- func (c *Client) DocumentCreate(target, id string, body any) (*http.Response, error)
- func (c *Client) DocumentRead(target, id string) (*http.Response, error)
- func (c *Client) IndexCreate(target string, body any) (*http.Response, error)
- func (c *Client) IndexPatch(target string, body any) (*http.Response, error)
Constants ¶
View Source
const ( // DefaultScheme is the HTTP scheme for the default server. DefaultScheme string = "https" // DefaultHost is the HTTP host for the default server. DefaultHost string = "127.0.0.1:9200" // DefaultServerURL is the HTTP host for the default server. DefaultServerURL string = "https://127.0.0.1:9200" MappingFieldKeyword = "keyword" // see: https://www.elastic.co/blog/strings-are-dead-long-live-strings MappingFieldRaw = "raw" // SlugCreate is the URL path part for creates. SlugCreate = "_create" SlugDoc = "_doc" SlugMapping = "_mapping" // SlugSearch is the URL path part for search. SlugSearch = "_search" // SlugUpdate is the URL path part for updates. SlugUpdate = "_update" TypeInteger = "integer" // More at: https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html TypeKeyword = "keyword" TypeString = "string" // Deprecation in ES5: https://www.elastic.co/blog/strings-are-dead-long-live-strings TypeText = "text" TypeMatchOnlyText = "match_only_text" )
Variables ¶
View Source
var ( ErrClientNotSet = errors.New("httpsimple.Client not set") ErrTargetNetSet = errors.New("target not set") )
Functions ¶
func NewConfigSimple ¶
func NewConfigSimple(addrURL, username, password string, tlsInsecureSkipVerify bool) elasticsearch.Config
func NewSimpleClient ¶
func NewSimpleClient(serverURL, username, password string, allowInsecure bool) (httpsimple.Client, error)
Types ¶
type Client ¶
type Client struct {
SimpleClient *httpsimple.Client
}
func (*Client) DocumentCreate ¶
DocumentCreate crates a document with the document id `id`. If `id` is empty, a document id is created.`
func (*Client) DocumentRead ¶
DocumentRead reads a document. Documented at: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html .
func (*Client) IndexCreate ¶
IndexCreate creates an index. Documented at: https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html .
func (*Client) IndexPatch ¶
IndexPatch patches an index. Documented at: https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html#add-field-mapping .
Click to show internal directories.
Click to hide internal directories.