您的位置:首页 > 其它

lucene demo 入门配置

2013-09-21 18:24 309 查看
在写这篇文章时,lucene的最新版本是4.1.0,文件可以从Apache站点(http://lucene.apache.org/)下载lucene-4.1.0.zip,

解压后有个demo文件夹就是lucene的demo,war文件程式可以运行在web容器中(tomcat,jboss,weblogic等),另外一个可以运行在j2se平台,

下面以tomcat容器为例,把lucene-xml-query-demo.war拷贝到webapps文件夹下,启动tomcta后自动解压,

如果需要错误class org.apache.lucene.xmlparser.webdemo.FormBasedXmlQueryDemo  no found,需要把web.xml下面的

<servlet-class>org.apache.lucene.xmlparser.webdemo.FormBasedXmlQueryDemo</servlet-class>

修改为

<servlet-class>org.apache.lucene.demo.xmlparser.FormBasedXmlQueryDemo</servlet-class>

然后把lucene-4.1.0解压包下

analysis\common\lucene-analyzers-common-4.1.0.jar

sandbox\lucene-sandbox-4.1.0.jar

这两个文件拷贝到WEB-INF\lib文件夹下面,运行如下:



转自:http://www.cnblogs.com/mikevictor07/archive/2013/01/31/2888313.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: