<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>臭皮匠 &#187; lucene</title>
	<atom:link href="http://guogoul.com/category/technology/lucene/feed/" rel="self" type="application/rss+xml" />
	<link>http://guogoul.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 Oct 2010 00:24:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>lucene::MultiSearcher解决最近索引的问题</title>
		<link>http://guogoul.com/2009/08/29/lucece_multisearcher/</link>
		<comments>http://guogoul.com/2009/08/29/lucece_multisearcher/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 14:41:14 +0000</pubDate>
		<dc:creator>shanfeng</dc:creator>
				<category><![CDATA[lucene]]></category>

		<guid isPermaLink="false">http://guogoul.com/?p=157</guid>
		<description><![CDATA[
需求：
1.索引N天之内的信息
2.索引最新的多少篇文章信息
注：由于信息量比较大，重建索引比较花时间太长。


解决方案:
1.单索引解决方案:
    对所有的信息进行增量索引, 在索引中加入时间轴信息或者文章ID信息。然后定期批量删除掉N天之前或者哪个ID之前的信息
2.多索引搜索解决：
    在建立索引的时候按天或者按ID分别建立不同的索引目录，例如: ~/indexpath/20090817,~/indexpath/20090818&#8230;&#8230;或者~/indexpath/id-200-300,~/indexpath/id-500-600&#8230;&#8230;。在搜索的时候按照需要进行组合索引搜索

个人比较推荐后者，因为它更加的灵活，简单,效率更高。
multisearcher示例code:


ArrayList as= new ArrayList();
Calendar cal = Calendar.getInstance();
String dname = "";
String path = "";
int n=7;  //最近一周的索引
for(int i=0;i]]></description>
		<wfw:commentRss>http://guogoul.com/2009/08/29/lucece_multisearcher/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

