📄 jahiasearchservice.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .////// JahiaSearchService// NK 25.01.2002 Integrate Lucene to implement search on container list.//package org.jahia.services.search;import java.io.*; // File access methodsimport java.util.*; // Vectorimport org.jahia.utils.*; // JahiaConsoleimport org.jahia.services.*; // JahiaServiceimport org.jahia.data.fields.*; // JahiaFieldsimport org.jahia.services.pages.JahiaPage;import org.jahia.data.search.*; // JahiaSearchimport org.jahia.params.*; // ParamBeanimport org.jahia.exceptions.JahiaException;/** * Search Service. * * @author DJ Original implementation * @author NK Extended for lucene integration. * */public abstract class JahiaSearchService extends JahiaService { //-------------------------------------------------------------------------- /** * Perform a search for a given JahiaSearcher object. * * @param ParamBean jParams, to check read access. * @return JahiaSearchResult, containing a vector of matching objects. */ public abstract JahiaSearchResult search ( JahiaSearcher jSearcher, ParamBean jParams ) throws JahiaException; //-------------------------------------------------------------------------- /** * Return a vector of matching pages. * Perform a search for a given query ( valid lucene query ). * The search is limited to the site returned by the param bean. * * @Deprecated Should use search method with PageSearcher instead. * @param String queryString, a valid lucene query string. * @param ParamBean jParams, to check read access. * @return JahiaSearchResult, containing a vector of matching page. */ public abstract JahiaSearchResult doSearch ( String queryString, ParamBean jParams ) throws JahiaException; //-------------------------------------------------------------------------- /** * Add a field to search engine. * With updated field, you should remove it first from search engine before * adding it again. * * @param JahiaField aField, the field to index. */ public abstract void addFieldToSearchEngine ( JahiaField aField ); //-------------------------------------------------------------------------- /** * Remove a field from search engine. * * @param JahiaField aField, the field to remove. */ public abstract void removeFieldFromSearchEngine ( JahiaField aField ); //-------------------------------------------------------------------------- /** * Re-index a full site. * Should be called under particular situations ( time consumming ). * * @param int siteID * @return boolean false on error. */ public abstract boolean indexSite (int siteID); //-------------------------------------------------------------------------- /** * Perform an index optimization for a given site. * * @param int siteID * @return boolean false on error. */ public abstract boolean optimizeIndex (int siteID); //-------------------------------------------------------------------------- /** * Return the full path to the directory containing the index for a given site. * * @param int siteID * @return String the site's index path, null if not exist. */ public abstract String getSiteIndex (int siteID) throws JahiaException ; //-------------------------------------------------------------------------- /** * Return the full path to search indexes root directory. * * @return String the site's index path, null if not exist. */ public abstract String getSearchIndexRootDir () throws JahiaException ; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -