package docs

type chapterLogs struct {
	defaultIndex string
}

var ChapterLogs = &chapterLogs{
	defaultIndex: "chapter_logs_0",
}

func (d *chapterLogs) SetIndex(index string) *chapterLogs {
	d.defaultIndex = index
	return d
}

func (d *chapterLogs) GetIndex() string {
	return d.defaultIndex
}

func (d *chapterLogs) Model() string {
	return `{
            "settings": {
				"number_of_shards": 1,
				"number_of_replicas": 0,
				"max_result_window": 100000,
				"refresh_interval": "1s"
            },
            "mappings": {
                "properties": {
                    "id": {
                        "type": "long"
                    },
                    "channel_id": {
                        "type": "keyword"
                    },
                    "flag": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "long"
                    },
                    "server_id": {
                        "type": "integer"
                    },
                    "event_id": {
                        "type": "integer"
                    },
                    "chapter_id": {
                        "type": "integer"
                    },
                    "difficulty": {
                        "type": "integer"
                    },
                    "room_id": {
                        "type": "integer"
                    },
                    "user_created_at": {
                        "type": "integer"
                    },
                    "event_at": {
                        "type": "integer"
                    },
                    "event_at_ns": {
                        "type": "long"
                    },
                    "token": {
                        "type": "keyword"
                    },
                    "extra": {
                        "type": "text"
                    }
                }
            }
        }`
}
