from: http://blog.163.com/ws_wishao/blog/static/1730469632013212101316176/
在写这篇文章时,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文件夹下面,运行如下:
from:http://www.cnblogs.com/mikevictor07/archive/2013/01/31/2888313.html