Ticket #32 (closed enhancement: fixed)
增量索引问题
| Reported by: | chenchongqi | Owned by: | chenyinle |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | 商家后台 | Version: | 5.0 |
| Keywords: | Cc: | ||
| Due Date: |
Description
1.原增量索引逻辑有问题,实际上每次执行需要更新的商品有七八万,之前的更新有遗漏。
2.每次更新太多商品导致查询商品很慢,而实际上这些大多数没有什么内容更新,应该使用另外的标志来查找更新的商品,另外对每次更新的商品数量做限制,把高峰期的压力分摊开。
Change History
comment:2 Changed 15 years ago by chenyinle
涉及的文件列表:
CompanyProductItem?
IndexBuilder?
CompanyProductService?
CompanyProductController?
涉及的方法:
1、CompanyProductItem加了个增量索引时间标志字段
2、IndexBuilder涉及的方法:getSelectProductSql、addProductIndex、addIncrementalProductIndex、getIncrementalProductIndexLastUpdateDate
3、CompanyProductService和CompanyProductController类的操作商品更新的主要部分
部署步骤:
1、数据库加字段
2、更新系统更新
3、重建索引,并监控是否有问题
总结:
感觉良好,如下:
增量/30分钟 改进前 改进后
数据规模 7-10万 3-7千
耗时 200-3xx秒 50-120秒
Note: See
TracTickets for help on using
tickets.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/global/2008/images/jss/m_logo091125.jpg)
解决增量的数量问题,增加了个新字段作为增量索引的更新依据。
对于更新商品数据的地方,什么情况才会更新增量索引字段,标准如下:
1、涉及到lucene索引的查询
2、涉及到lucene索引的显示
总的来说就是,商家的数据更新,影响到搜索结果,才会修改增量索引标识字段