⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waredaoimpl.java

📁 在SSH框架下用Lucene做的一个搜索引擎系统
💻 JAVA
字号:
package com.hapark.dao;

import java.util.List;

import org.apache.lucene.search.Hits;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.hapark.lucene.WareIndex;
import com.hapark.lucene.WareSearch;
import com.hapark.model.Search;

public class WareDAOImpl extends HibernateDaoSupport implements WareDAO  {

    public WareIndex wareIndex ;
    public WareSearch wareSearch;
    
	public void addIndex() throws Exception {
		
		List<Search> list = this.getHibernateTemplate().find("from Search");
		
		wareIndex.create(list);
		
	}

	public Hits searchIndex(String key, String city) throws Exception {

		Hits hits = wareSearch.search(key, city);
		return hits;
	}
	
	

	public void setWareIndex(WareIndex wareIndex) {
		this.wareIndex = wareIndex;
	}

	public void setWareSearch(WareSearch wareSearch) {
		this.wareSearch = wareSearch;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -