package com.uas.search.console.util;

/**
 * 索引相关的常量
 * 
 * @author suntg
 * @since 2016年8月3日下午1:54:14
 */
public class SearchConstants {

	/**
	 * 默认搜索的最大的记录条数
	 */
	public static final int TOP_NUM = 1024 * 1024 * 1024;

	/**
	 * 关键词最大允许长度
	 */
	public static final int KEYWORD_MAX_LENGTH = 30;

	/**
	 * 消息队列名，该队列存放kind、brand、component等表的改动信息
	 */
	public static final String LUCENE_QUEUE_NAME = "lucene_queue";

	/**
	 * 消息队列对应的表
	 */
	public static final String LUCENE_QUEUE_TABLE_NAME = "lucene_queue_tb";

	/**
	 * 类目表名
	 */
	public static final String KIND_TABLE_NAME = "product$kind";

	/**
	 * 品牌表名
	 */
	public static final String BRAND_TABLE_NAME = "product$brand";

	/**
	 * 器件表名
	 */
	public static final String COMPONENT_TABLE_NAME = "product$component";

	/**
	 * 商城销售订单表名
	 */
	public static final String ORDER_TABLE_NAME = "trade$order";

	/**
	 * 商城销售订单的发货单表名
	 */
	public static final String ORDER_INVOICE_TABLE_NAME = "trade$invoice_fmor";

	/**
	 * 商城采购订单表名
	 */
	public static final String PURCHASE_TABLE_NAME = "trade$purchase";

	/**
	 * 商城采购订单的发货单表名
	 */
	public static final String PURCHASE_INVOICE_TABLE_NAME = "trade$invoice_fmpu";

	/**
	 * 单据搜索时，若限定时间范围，可以键值对的形式传递参数，该键代表最小（远）时间
	 */
	public static final String MIN_TIME_KEY = "mintime";

	/**
	 * 单据搜索时，若限定时间范围，可以键值对的形式传递参数，该键代表最大（近）时间
	 */
	public static final String MAX_TIME_KEY = "maxtime";

	// 类目索引字段的key
	public static final String KIND_ID_FIELD = "ki_id";
	public static final String KIND_NAMECN_FIELD = "ki_name_cn";
	public static final String KIND_LEVEL_FIELD = "ki_level";
	public static final String KIND_ISLEAF_FIELD = "ki_isleaf";

	// 品牌索引字段的key
	public static final String BRAND_ID_FIELD = "br_id";
	public static final String BRAND_NAMECN_FIELD = "br_name_cn";
	public static final String BRAND_NAMEEN_FIELD = "br_name_en";
	public static final String BRAND_UUID_FIELD = "br_uuid";
	public static final String BRAND_WEIGHT_FIELD = "br_weight";

	// 器件索引字段的key
	public static final String COMPONENT_ID_FIELD = "cmp_id";
	public static final String COMPONENT_UUID_FIELD = "cmp_uuid";
	public static final String COMPONENT_CODE_FIELD = "cmp_code";
	public static final String COMPONENT_KINDID_FIELD = "cmp_kind_id";
	public static final String COMPONENT_KINDNAME_FIELD = "cmp_kind_name_cn";
	public static final String COMPONENT_BRANDID_FIELD = "cmp_brand_id";
	public static final String COMPONENT_RESERVE_FIELD = "cmp_reserve";
	public static final String COMPONENT_SAMPLE_QTY_FIELD = "cmp_sample_qty";
	public static final String COMPONENT_ORIGINAL_QTY_FIELD = "cmp_original_qty";
	public static final String COMPONENT_INACTION_STOCK_QTY_FIELD = "cmp_inaction_stock_qty";
	public static final String COMPONENT_BRANDUUID_FIELD = "cmp_brand_uuid";
	public static final String COMPONENT_BRANDNAME_FIELD = "cmp_brand_name_cn";
	/**
	 * 创建器件属性的索引时，在属性id的前面添加该前缀作为Field的键
	 */
	public static final String COMPONENT_PROPERTY_PREFIX = "pr_";
	/**
	 * 另外创建的经过分词的属性值，添加后缀作为Field的键
	 */
	public static final String COMPONENT_PROPERTY_TOKENIZED_SUFFIX = "_tokenized";

	// 商城销售订单索引字段的key
	/**
	 * 对应销售单id（数据库id字段）
	 */
	public static final String ORDER_ID_FIELD = "or_id";
	/**
	 * 对应销售单号（数据库or_id字段），因易与id命名混淆，其他类、lucenne建索引时该字段难以区分，特以此命名
	 */
	public static final String ORDER_CODE_FIELD = "or_code";
	public static final String ORDER_BUYERUU_FIELD = "or_buyeruu";
	public static final String ORDER_BUYERNAME_FIELD = "or_buyername";
	public static final String ORDER_BUYERENUU_FIELD = "or_buyerenuu";
	public static final String ORDER_BUYERENNAME_FIELD = "or_buyerenname";
	public static final String ORDER_SELLERENUU_FIELD = "or_sellerenuu";
	public static final String ORDER_SELLERENNAME_FIELD = "or_sellerenname";
	public static final String ORDER_CREATETIME_FIELD = "or_createtime";
	public static final String ORDER_STATUS_FIELD = "or_status";
	public static final String ORDER_DETAILS_FIELD = "or_details";

	// 商城销售订单的发货单索引字段的key
	/**
	 * 对应商城销售订单的发货单id（数据库id字段）
	 */
	public static final String ORDER_INVOICE_ID_FIELD = "oi_id";
	/**
	 * 对应销售单发货单号（数据库in_id字段），因易与id命名混淆，其他类、lucenne建索引时该字段难以区分，特以此命名
	 */
	public static final String ORDER_INVOICE_CODE_FIELD = "oi_code";
	public static final String ORDER_INVOICE_BUYERUU_FIELD = "oi_buyeruu";
	public static final String ORDER_INVOICE_BUYERNAME_FIELD = "oi_buyername";
	public static final String ORDER_INVOICE_BUYERENUU_FIELD = "oi_buyerenuu";
	public static final String ORDER_INVOICE_BUYERENNAME_FIELD = "oi_buyerenname";
	public static final String ORDER_INVOICE_CREATETIME_FIELD = "oi_createtime";
	public static final String ORDER_INVOICE_STATUS_FIELD = "oi_status";
	public static final String ORDER_INVOICE_DETAILS_FIELD = "oi_details";

	// 商城采购订单索引字段的key
	/**
	 * 对应采购单id（数据库id字段）
	 */
	public static final String PURCHASE_ID_FIELD = "pu_id";
	/**
	 * 对应采购单号（数据库pu_id字段），因易与id命名混淆，其他类、lucenne建索引时该字段难以区分，特以此命名
	 */
	public static final String PURCHASE_CODE_FIELD = "pu_code";
	public static final String PURCHASE_SELLERENUU_FIELD = "pu_sellerenuu";
	public static final String PURCHASE_SELLERENNAME_FIELD = "pu_sellerenname";
	public static final String PURCHASE_CREATETIME_FIELD = "pu_createtime";
	public static final String PURCHASE_STATUS_FIELD = "pu_status";
	public static final String PURCHASE_DETAILS_FIELD = "pu_details";

	// 商城采购订单的发货单索引字段的key
	/**
	 * 对应商城采购订单的发货单id（数据库id字段）
	 */
	public static final String PURCHASE_INVOICE_ID_FIELD = "pi_id";
	/**
	 * 对应采购单发货单号（数据库in_id字段），因易与id命名混淆，其他类、lucenne建索引时该字段难以区分，特以此命名
	 */
	public static final String PURCHASE_INVOICE_CODE_FIELD = "pi_code";
	public static final String PURCHASE_INVOICE_SELLERENUU_FIELD = "pi_sellerenuu";
	public static final String PURCHASE_INVOICE_SELLERENNAME_FIELD = "pi_sellerenname";
	public static final String PURCHASE_INVOICE_CREATETIME_FIELD = "pi_createtime";
	public static final String PURCHASE_INVOICE_STATUS_FIELD = "pi_status";
	public static final String PURCHASE_INVOICE_DETAILS_FIELD = "pi_details";

}
