using MongoDB.Bson.Serialization.Attributes;
using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 

namespace CsvCount_ES
{
    /// <summary>
    /// 全局公用的单Item数据包
    /// </summary>
    [ElasticsearchType(Name = "items")]
    public class Item  
    {
       

        public Item()
        {

        }

        /// <summary>
        /// 文章ID
        /// </summary>
        public string ItemID { get; set; }
 
 
        /// <summary>
        /// 文章Url
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string CleanTitle { get; set; }


        /// <summary>
        /// 正文
        /// </summary>
        public string CleanText { get; set; }



        /// <summary>
        /// 页面显示发布时间
        /// </summary>
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime PubDate { get; set; }



        /// <summary>
        /// 媒体名称（分词索引）
        /// </summary>
        public string MediaName { get; set; }


        /// <summary>
        /// 相似转载ID（早先入库的相似文章ID，第一篇该字段为空，其他均为第一篇的ID）
        /// </summary>
        public string DuplicationID { get; set; }


        ///<summary>
        ///分析字段，每个客户一条记录(支持不同的分析模型)
        ///</summary>
        [Nested(IncludeInParent = true)]//(Path = "analyzeData")]
        public ItemAnalyzeData[] AnalyzeData { get; set; }


    }

    /// <summary>
    /// 语义分析结果(每Issue可不同)
    /// </summary>
    [Serializable]
    public class ItemAnalyzeData
    {

        /// <summary>
        /// 议题编号
        /// </summary>
        public string IssueID { get; set; }

        /// <summary>
        /// 品类/市场编号
        /// </summary>
        public string[] MarketIDs { set; get; }
        /// <summary>
        /// 主题/板块编号
        /// </summary>
        public string[] BlockIDs { set; get; }
        /// <summary>
        /// 股票编号
        /// </summary>
        public string[] StockIDs { set; get; }

        /// <summary>
        /// IG Tree
        /// </summary>
        public string IG { set; get; }



        public ItemAnalyzeData()
        {

        }

    }

}
