id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	due_date
88	xindex 文件及指令格式说明(电脑网专用)	chenchongqi		"这里是针对通用说明的补充，通用说明在这里：http://svn.demo.pc.com.cn/svn/xindex/trunk/README.txt

= index文件 =
* 文件名
 a. 历史产品：小类id-h.txt 如手机历史产品 20937-h.txt
 b. 非历史产品：小类id.txt 如手机非历史产品 20937.txt

* 文件格式
{{{
Record struct match Query

--------+---+-------------------+-----------+
Field   |ID | IndexField        | ExtraField|
        |   | 0   1   2   3   4 | 0   1   2 |
--------+---+---+---+---+---+---+---+---+---+
Record  | x | x | x | x | x | x | x | x | x |
        | x | x | x | x | x | x | x | x | x |
        | x | x | x | x | x | x | x | x | x |
        | x | x | x | x | x | x | x | x | x |
        | x | x | x | x | x | x | x | x | x |
        | x | x | x | x | x | x | x | x | x |
--------+---+---+---+---+---+---+---+---+---+
Query   |   | m0| m1| m2| m3| m4|   |   |   | match
        +---+---+---+---+---+---+---+---+---+
        |   |   |   |   |   |   | 0 | 1 | 2 | sort_index
        +---+---+---+---+---+---+---+---+---+
        |   | x |   |   |   |   |   |   |   | sort_price
--------+---+---+---+---+---+---+---+---+---+
}}}
 * IndexField
  a. m0:全国价
  b. m1:品牌
  c. m2-m7:自定义查询项item1-item6
 * ExtraField
  a. e1:热度
  b. e2:创建时间
  c. e3:评分
  d. e4:北京分站价格
  e. e5:上海分站价格
  f. e6:广州分站价格
  g. e7:深圳分站价格
  h. e8:成都分站价格

= price文件 =
* 文件名 price.txt
* 文件格式
{{{
北上广深成都价格在ExtraField中的位置
@first_area:
---------+----+----+----+----+----+----+
Area ID  | a0 | a1 | a2 | a3 | a4 | a5 |
---------+----+----+----+----+----+----+
Field ID | m0 | e4 | e5 | e6 | e7 | e8 |
---------+----+----+----+----+----+----+
a0 全国地区id
a1-a5 北上广深地区id

分站对应关系
@second_area:
--------------+----+----+----+----+----+----+
Minor Area ID | n1 | n2 | n3 | n4 | n5 | n6 | ... 
--------------+----+----+----+----+----+----+
Main Area ID  | a1 | a1 | a1 | a2 | a2 | a3 | ...
--------------+----+----+----+----+----+----+
n1-nx 除了北上广深成都全国外其他各小分站地区id
a1-a5 被引用的主要分站地区id

分站本地价格
@second_area_price:
--------+------------+-------+
Area Id | Product Id | Price |
--------+------------+-------+
}}}

== 例子 ==
* 查手机历史产品，品牌是26588，按全国价格倒序(缺省)排序，offset是0，50条：index=20937-h+m1=26588+sort_price+limit=0,50
* 查手机非历史产品，品牌是26588，地区是1(广州)，按地区广州价格正序排序，offset是100，50条：index=20937+area=1+m1=26588+sort_price+asc+limit=100,50
* 查手机非历史产品，品牌是26588，地区是30(无报价的小分站)，按地区报价正序排序，offset是100，50条：index=20937+area=30+m1=26588+sort_price+asc+limit=100,50
* 不管是北上广深成都还是其他引用这些分站的小分站，用价格排序的都是直接sort_price搞定
"	需求	new	major	2012报价库5.0	报价库	报价库5.0		xindex		
