namespace JiaZhiQuan.Common.ElasticSearch
{
    public static class ESConstants
    {
        public static string DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

        public static class ESIndexName
        {
            // ES文章表
            public static string Post = "post_alias";

            // ES Log表
            public static string NLog = "n_log";

            // ES IP地址映射表
            public static string IpAddress = "ip_addr";

            // ES 手机号地址映射表
            public static string MobileAddress = "mobile_addr";

            // ES 用户关注记录表
            public static string UserFansRecords = "user_fans_record";

            // ES 用户收藏记录表
            public static string UserCollectRecords = "user_collect_record";

            // ES 用户点赞记录表
            public static string UserThumbsupRecords = "user_thumbsup_record";

            // ES 商品数据
            public static string MallGoods = "mall_goods";
        }

        public static class ResponseKey
        {
            /// <summary>
            /// 最外层的aggregations对象
            /// </summary>
            public static string AGGREGATIONS = "aggregations";

            /// <summary>
            /// aggregations统计结果对象的key
            /// </summary>
            public static string AGGREGATIONS_COUNT = "doc_count";

            /// <summary>
            /// 最外层的hits对象
            /// </summary>
            public static string HITS = "hits";

            /// <summary>
            /// ES返回的数据结构中有两层hits，这个是第二层的
            /// 这个对象包含index的基础信息以及返回的数据
            /// </summary>
            public static string HITS_HITS = "hits";

            /// <summary>
            /// 行数据的ID
            /// </summary>
            public static string HITS_HITS_SOURCE = "_source";

            /// <summary>
            /// 返回的查询结果数据
            /// </summary>
            public static string HITS_HITS_ID = "_id";

            /// <summary>
            /// 查询结果total对象
            /// </summary>
            public static string HITS_TOTAL = "total";

            /// <summary>
            /// 数据条数
            /// </summary>
            public static string HITS_TOTAL_VALUE = "value";
        }
    }
}
