pagesearcher.java

来自「java 写的一个新闻发布系统」· Java 代码 · 共 86 行

JAVA
86
字号
////                                   ____.//                       __/\ ______|    |__/\.     _______//            __   .____|    |       \   |    +----+       \//    _______|  /--|    |    |    -   \  _    |    :    -   \_________//   \\______: :---|    :    :           |    :    |         \________>//           |__\---\_____________:______:    :____|____:_____\//                                      /_____|////                 . . . i n   j a h i a   w e   t r u s t . . .////////package org.jahia.services.search;import org.jahia.params.*;          		// ParamBeanimport org.jahia.registries.*;     	 		// JahiaRegistriesimport org.jahia.exceptions.*;import org.jahia.data.search.JahiaSearchResult;/** * Handle pages search. * The result for this searcher is an instance of JahiaSearchResult and is a vector of matching pages. * * @author Khue Nguyen <a href="mailto:khue@jahia.org">khue@jahia.org</a> */public class PageSearcher extends JahiaSearcher {    private static final String CLASS_NAME = PageSearcher.class.getName();		//--------------------------------------------------------------------------	/**	 * Constructor	 *	 */ 	public PageSearcher()	{	}		//--------------------------------------------------------------------------	/**	 * Perform the search for a given query as String.	 * The expected result is a JahiaSearchResult object containing a vector of matching pages.	 *	 * @param String query, a valid query.	 * @param ParamBean jParams, the param bean.	 * @return JahiaSearchResult result, the expected result as an instance of JahiaSearchResult object	 */	public JahiaSearchResult search(String query, ParamBean jParams)	throws JahiaException	{		JahiaSearchResult result = null;				// Must set the query first.		setQuery(query);				// Perform the search.		ServicesRegistry sReg = ServicesRegistry.getInstance();		result = sReg.getJahiaSearchService().search(this,jParams);				// Store the result.		setResult(result);				return result;	}	//--------------------------------------------------------------------------	/**	 * Return the searcher name which value is JahiaSearcher.PAGE_SEARCHER.	 *	 * The search service must return a result of JahiaSearchResult type for this searcher.	 *	 * @return String name, the searcher name.	 */	public String getName()	{		return this.PAGE_SEARCHER;	}}

⌨️ 快捷键说明

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