elastic

package
v0.0.0-...-0bc60f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2015 License: MIT Imports: 7 Imported by: 0

README

Create ElasticSearch index templates

Visit index

{
    "template": "tracker-*",
    "mappings": {
        "visit": {
            "properties": {
                "_source": { "enabled": false },
                "_index": { "enabled": false },
                "_type": { "enabled": false },
                "_all": { "enabled": false },
                "_id": { "index": "not_analyzed", "stored": true, "type": "string" },
                "@timestamp": { "format": "YYYY-MM-DD HH:mm:ss", "type": "date" },
                "clientId": { "index": "not_analyzed", "type": "string" },
                "fields": {
                    "include_in_parent": true,
                    "type": "nested",
                    "properties": {
                        "key": { "index": "not_analyzed", "type": "string" },
                        "value": { "index": "not_analyzed", "type": "string" }
                    }
                },
                "sessionId": { "index": "not_analyzed", "type": "string" },
                "warnings": { "index": "not_analyzed", "type": "string" }
            }
        },
        "flash": {
            "properties": {
                "_source": { "enabled": false },
                "_index": { "enabled": false },
                "_type": { "enabled": false },
                "_all": { "enabled": false },
                "_id": { "index": "not_analyzed", "stored": true, "type": "string" },
                "@timestamp": { "format": "YYYY-MM-DD HH:mm:ss", "type": "date" },
                "visitId": { "index": "not_analyzed", "type": "string" },
                "visitFields": {
                    "include_in_parent": true,
                    "type": "nested",
                    "properties": {
                        "key": { "index": "not_analyzed", "type": "string" },
                        "value": { "index": "not_analyzed", "type": "string" }
                    }
                },
                "eventFields": {
                    "include_in_parent": true,
                    "type": "nested",
                    "properties": {
                        "key": { "index": "not_analyzed", "type": "string" },
                        "value": { "index": "not_analyzed", "type": "string" }
                    }
                }
            }
        }
    }
}

Event index

{
    "template": "tracker",
    "mappings": {
        "event": {
            "properties": {
                "_source": { "enabled": false },
                "_index": { "enabled": false },
                "_type": { "enabled": false },
                "_all": { "enabled": false },
                "_id": { "index": "not_analyzed", "stored": true, "type": "string" },
                "enabled": { "type": "boolean" },
                "fields": {
                    "include_in_parent": true,
                    "type": "nested",
                    "properties": {
                        "key": { "index": "not_analyzed", "type": "string" },
                        "value": { "index": "not_analyzed", "type": "string" }
                    }
                },
                "filters": {
                    "include_in_parent": true,
                    "type": "nested",
                    "properties": {
                        "key": { "index": "not_analyzed", "type": "string" },
                        "value": { "index": "not_analyzed", "type": "string" }
                    }
                }
            }
        }
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	RefreshAfterInsert bool
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(client *driver.Client, uuid share.UUIDProviderInterface) (*Repository, error)

func (*Repository) FindAll

func (repository *Repository) FindAll(limit int64, offset int64) (result []*entity.Flash, err error)

func (*Repository) FindAllByEventID

func (repository *Repository) FindAllByEventID(
	eventID types.UUID,
	limit int64,
	offset int64,
) (result []*entity.Flash, err error)

func (*Repository) FindAllByVisitID

func (repository *Repository) FindAllByVisitID(visitID types.UUID) (result []*entity.Flash, err error)

func (*Repository) FindByID

func (repository *Repository) FindByID(flashID types.UUID) (result *entity.Flash, err error)

func (*Repository) Insert

func (repository *Repository) Insert(flash *entity.Flash) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL