Package com.easydesk.lucene
Class DefaultSearchClient
java.lang.Object
com.easydesk.lucene.DefaultSearchClient
- All Implemented Interfaces:
IndexConstants,Indexer,LocalSearchable,Searchable
같은 JVM 의
SearchService 를 사용하는 client.
기존 Avalon DefaultSearchClient 를 대체한다. Avalon ServiceManager.lookup(SearchService.ROLE) 대신
생성자로 SearchService 를 주입받는다.
- Author:
- 조 영 호
-
Field Summary
Fields inherited from interface com.easydesk.lucene.IndexConstants
AND, ATTACHMENT_ID, ATTACHMENT_PREFIX, ATTACHMENT_TYPE_ID, ATTRIBUTE_ID, ATTRIBUTE_PREFIX, CREATED_DATE, CREATER_NAME, CREATER_NICK_NAME, CREATER_USER_NAME, DATE, DEPEND_ID, DEPEND_TYPE_ID, FLOAT_NUMBER, ITEM_ID, KEY_WORD, MODULE_ID, NUMBER, OR, PARENT_ID, RANGE, TEXT, USER_ID, USER_ITEM_ID, VALUE_ID -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSearchClient(SearchService searchService) Creates a new DefaultSearchClient. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocument(Indexable indexable) document 를 index 에 추가(교체)한다. document 가null이고 unique term 이 있으면 index 에서 제거한다.org.apache.lucene.analysis.AnalyzerAnalyzerprotected SearchServicevoidindex 를 진행한다.booleanisLocal()서버가 Local 인지 아니면 Remote 인지search itemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.easydesk.lucene.Indexer
getVersion
-
Constructor Details
-
DefaultSearchClient
Creates a new DefaultSearchClient.- Parameters:
searchService- search service
-
-
Method Details
-
getSearcher
- Returns:
- search service
-
isLocal
public boolean isLocal()Description copied from interface:Searchable서버가 Local 인지 아니면 Remote 인지- Specified by:
isLocalin interfaceSearchable- Returns:
- local 이면 true
-
getAnalyzer
public org.apache.lucene.analysis.Analyzer getAnalyzer()Description copied from interface:IndexerAnalyzer- Specified by:
getAnalyzerin interfaceIndexer- Returns:
- analyzer
-
search
Description copied from interface:Searchablesearch item- Specified by:
searchin interfaceSearchable- Parameters:
info- query 정보moduleFilter- 검색이 허용된 module id 의 BitSet.null이면 module filter 를 적용하지 않고, 비어 있으면 검색이 허용된 module 이 없으므로 결과가 없다. (기존BitVector를 대체)path- index path (index root 기준 상대 경로) 배열.*는 경로 한 단계와 일치한다. (예: 모든 module 의 itemType 12 attribute index :*/attribute/12)- Returns:
IndexConstants.ITEM_ID를 수집한 BitSet- Throws:
IOException- search engine 오류
-
addDocument
document 를 index 에 추가(교체)한다. document 가null이고 unique term 이 있으면 index 에서 제거한다.- Specified by:
addDocumentin interfaceSearchable- Parameters:
indexable- index 대상- Throws:
IOException- index 오류
-
index
Description copied from interface:Indexerindex 를 진행한다.- Specified by:
indexin interfaceIndexer- Parameters:
indexable- index 대상- Throws:
IndexerException- index 오류
-