<?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>Computer, Electron and Technology &#187; lucene</title>
	<atom:link href="http://www.donevii.com/post/tag/lucene/feed" rel="self" type="application/rss+xml" />
	<link>http://www.donevii.com</link>
	<description>关注技术、移动互联网以及一切 GEEK &#38; NERD 的事情</description>
	<lastBuildDate>Wed, 21 Dec 2011 10:49:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>(转)lucene安装</title>
		<link>http://www.donevii.com/post/301.html</link>
		<comments>http://www.donevii.com/post/301.html#comments</comments>
		<pubDate>Wed, 31 Jan 2007 07:46:02 +0000</pubDate>
		<dc:creator>gavinkwoe</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[测试]]></category>
		<category><![CDATA[车东]]></category>

		<guid isPermaLink="false">http://www.donevii.com/?p=301</guid>
		<description><![CDATA[网上有许多lucene的材料，中文材料大家看的都是车东的那篇(http://www.chedong.com/tech/lucene.html)，而大家在网上讨论最多的是中文的全文检索，而对中文的全文检索最有影响力的文章，还是车东写的... ]]></description>
			<content:encoded><![CDATA[<p>网上有许多lucene的材料，中文材料大家看的都是车东的那篇(http://www.chedong.com/tech/<a href="http://www.donevii.com/post/tag/lucene" class="st_tag internal_tag" rel="tag" title="Posts tagged with lucene">lucene</a>.<a href="http://www.donevii.com/post/tag/html" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">html</a>)，而大家在网上讨论最多的是中文的全文检索，而对中文的全文检索最有影响力的文章，还是车东写的那篇weblucene(http://www.chedong.com/tech/weblucene.<a href="http://www.donevii.com/post/tag/html" class="st_tag internal_tag" rel="tag" title="Posts tagged with html">html</a>)，但那些都是lucene1.2版本的事，现在不同了，<a href="http://www.donevii.com/post/tag/lucene" class="st_tag internal_tag" rel="tag" title="Posts tagged with lucene">lucene</a>1.3-final据称完全支持中文的全文检索了。<br />
因为在lucene1.3-final.zip包中的changes.txt中的第五项描述如下：<br />
5. Fix StandardTokenizer’s handling of CJK characters (Chinese,<br />
 Japanese and Korean ideograms). Previously contiguous sequences<br />
 were combined in a single token, which is not very useful. Now<br />
 each ideogram generates a separate token, which is more useful.<br />
这说明lucene1.3-final可以检索中日韩等表意文字了。<br />
<br />
测试一下：<br />
测试环境：<a href="http://www.donevii.com/post/tag/windows" class="st_tag internal_tag" rel="tag" title="Posts tagged with windows">windows</a> 2000 pro,jdk1.3.1或以上版本<br />
1、下载lucene-1.3-final.zip。<br />
<br />
2、解压lucene-1.3-final.zip，并将其中的lucene-1.3-final.jar和lucene-demos-1.3-final.jar加入到系统的classpath中。<br />
<br />
3、建一个目录，并将一些html或txt文件（文件内容要中文的！）拷入到这个目录中，作为全文检索的材料。如：建一个目录d:\lucenetest\index，在其中拷入一些中文内容的文件，其中也可以有多级子目录的。<br />
OK，环境准备好了，可以试验了！<br />
<br />
4、进入dos模式，输入命令：<a href="http://www.donevii.com/post/tag/java" class="st_tag internal_tag" rel="tag" title="Posts tagged with java">java</a> org.apache.lucene.demo.IndexFiles d:\lucenetest\index<br />
如：c:\&gt;java org.apache.lucene.demo.IndexFiles d:\lucenetest\index 回车，这时会索引d:\lucenetest\index目录下的所有文件，包括子目录中的文件，并将索引文件写入：c:\index目录中（自动创建的,根据你的dos符起始路径，将在其下建index目录）。<br />
好，索引建完了，下面试验检索。<br />
<br />
5、输入命令：java org.apache.lucene.demo.SearchFiles<br />
如：c:\&gt;java org.apache.lucene.demo.SearchFiles 回车<br />
Query:在这里输入检索内容，如：“建议最好自己先做一下语法检查”，这么长：）<br />
成功了，结果出来了：<br />
Searching for: “建 议 最 好 自 己 先 做 一 下 语 法 检 查”<br />
1 total matching documents<br />
0. d:\lucenetest\index\学习Lucene的一点心得.txt<br />
可以看出lucene-1.3-final完全支持中文的全文检索了，使用的是单字切分！！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.donevii.com/post/301.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

