- 浏览: 46742 次
最新评论
文章列表
修改mainTest测试类
public class mainTest {
/**
* Function:抓取网页内容
* @author JLC
* @return
*/
public static List<Document> getWebContentDocuments(){
List<Document> docs = new ArrayList<Document>();
W ...
- 2014-02-08 09:13
- 浏览 311
- 评论(0)
参考mainTest.java里的main方法
public class mainTest {
/**
* Function:抓取网页内容
* @author JLC
* @return
*/
public static List<Document> getWebContentDocuments(){
List<Document> docs = new ArrayList<Document>();
WebContent wc = new WebContent( ...
- 2014-02-08 09:11
- 浏览 414
- 评论(0)
┳
┣com.searchengine.entity.ContentObject.java (内容对象)
┣com.searchengine.util.WebContent.java(取得网页内容)
┗com.searchengine.util.PackContentObject(对象转换)
ContentObject.java代码
/**
* Class Name: ContentObject.java 搜索引擎内容对象
* @author JLC
* @version 1.0
*/
public class ContentObject {
/**
...
- 2014-02-08 09:09
- 浏览 398
- 评论(0)
搜索引擎核心代码 -- SearchObject.java
package com.searchengine.core;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.NRTManager;
public class SearchObject {
private stati ...
- 2014-02-08 09:08
- 浏览 428
- 评论(0)
搜索核心代码 -- SearchEngineCore.java
package com.searchengine.core;
import java.io.File;
import java.io.IOException;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.luc ...
- 2014-02-08 09:05
- 浏览 335
- 评论(0)
Lucene是apache软件基金会jakarta项目组的一个子项目,是一个开放源代码的全文检索引擎工具包,即它不是一个完整的全文检索引擎,而是一个全文检索引擎的架构,提供了完整的查询引擎和索引引擎,部分文本分析引擎(英文与德文两种西方语言)。Lucene的目的是为软件开发人员提供一个简单易用的工具包,以方便的在目标系统中实现全文检索的功能,或者是以此为基础建立起完整的全文检索引擎。
1.官方网站下载地址:Apache Lucene4.2.1
2.利用MyEclipse开发工具创建Web工程
3.导入Lucene开发包
4.创建工程Package
- 2014-02-08 09:04
- 浏览 429
- 评论(0)
最近再看Lucene,在网上也看了不少的例子,现在把我做的拿出来。
1、首先去http://mirrors.cnnic.cn/apache/lucene/java/4.5.0/下载lucene4.5的jar包。解压出来
2、在MyEclipse里面新建一个JAVA项目,将以下jar包拷入项目,其中junit-4.11.jar是测 ...
- 2014-02-08 08:51
- 浏览 479
- 评论(0)
JSP页面
When using the JSTL's expression language , the request parameters are made available in the implicit objectparam. This example demonstrates how to include the value of a request parameter from the query string or posted data in the generated
output:
翻一下:当使用jstl时,url请求参数被放置到隐含对象param中, ...
- 2014-01-14 17:34
- 浏览 618
- 评论(0)
1.? 获取web服务器项目的真实物理路径
02
request.getSession().getServletContext().getRealPath("/");
03
2.? 相对路径的获得
04
说明:相对路径(即不写明时候到底相对谁)均可通过以下方式获得(不论是一般的java项目还是web项目)
05
String relativelyPath=System.getProperty("user.dir");
06
上述相对路径中,java项目中的文件是相对于项目 ...
- 2014-01-13 10:38
- 浏览 417
- 评论(0)