package com.xt.hb.data.search;

import javax.servlet.http.HttpServletRequest;

import org.apache.solr.common.SolrDocumentList;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xt.hb.data.util.SolrClientUtils;

/**
 * solr检索
 * 
 * @author 袁晓冬
 *
 */
@Controller
public class SearchCtl {
	/**
	 * 查询
	 * 
	 * @param keyword
	 * @return
	 */
	@RequestMapping(value = "search/{keyword}")
	@ResponseBody
	public SolrDocumentList search(@PathVariable String keyword, HttpServletRequest request) {
		SolrDocumentList list = SolrClientUtils.query(keyword);
		return list;
	}
}
