lucene4.1.0 demo (jsp)配置

来源:互联网 发布:旋转变换矩阵 编辑:程序博客网 时间:2024/05/16 15:02

lucene4.1.0 demo 配置

 

转载自:http://www.cnblogs.com/mikevictor07/archive/2013/01/31/2888313.html

在写这篇文章时,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文件夹下面,运行如下: