Class EmptySearcher

java.lang.Object
com.easydesk.util.word.EmptySearcher
All Implemented Interfaces:
SearchIndex
Direct Known Subclasses:
LuceneSearchIndex

public class EmptySearcher extends Object implements SearchIndex
검색 조건만 모으고 항상 빈 결과를 돌려준다. (test 용, LuceneSearchIndex 의 base class)

기존 com.nannet.jettiger.util.word.EmptySearcher 의 port 이다. Fulcrum Recyclable (pool) 은 사용하지 않는다. 이 class 는 thread-safe 하지 않으므로 검색마다 새로 생성하여야 한다.

Author:
조 영 호
  • Field Details

    • log

      protected final org.slf4j.Logger log
      Logger
    • searchService

      protected Searchable searchService
      SearchEngine
    • attributeIds

      protected final List<Integer[]> attributeIds
      the attributes that will be searched
    • queryText

      protected final List<String> queryText
      the words and boolean operators
    • rangeValues

      protected final List<AttributeValue> rangeValues
      the range attribute values
    • keywordValues

      protected final List<AttributeValue> keywordValues
      the keyword attribute values
    • attachmentIds

      protected final List<Integer[]> attachmentIds
      the attachments that will be searched
    • attachmentQueryText

      protected final List<String> attachmentQueryText
      the words and boolean operators
    • searcherId

      protected int searcherId
      current searcher userId
    • indexNames

      protected String[] indexNames
      index Name array for query
    • moduleFilter

      protected BitSet moduleFilter
      query module filter, null 이면 module 을 한정하지 않는다.
    • queryInfos

      protected QueryInfo[] queryInfos
      queryInfo array to ask SearchEngine
    • locale

      protected Locale locale
      query locale
  • Constructor Details

    • EmptySearcher

      public EmptySearcher()
  • Method Details

    • setSearchService

      public void setSearchService(Searchable searchService)
      Description copied from interface: SearchIndex
      DOCUMENT ME!
      Specified by:
      setSearchService in interface SearchIndex
      Parameters:
      searchService - DOCUMENT ME!
    • setLocale

      public void setLocale(Locale locale)
      Description copied from interface: SearchIndex
      DOCUMENT ME!
      Specified by:
      setLocale in interface SearchIndex
      Parameters:
      locale - DOCUMENT ME!
    • setMITFilter

      public void setMITFilter(BitMatrix bitMatrix, boolean includeAttachment) throws TorqueException
      Description copied from interface: SearchIndex
      검색 대상 Module/ItemType 으로 index location 과 module filter 를 구성한다.
      Specified by:
      setMITFilter in interface SearchIndex
      Parameters:
      bitMatrix - 검색 대상 (x : Module id, y : ItemType id), 보통 MITList.getBitMatrix()
      includeAttachment - attachment index 도 검색할지
      Throws:
      TorqueException - 조회 오류
    • addQuery

      public void addQuery(Integer[] ids, String text)
      Text 한 검색문자열을 여러 속성에 설정할 수 있다.
      Specified by:
      addQuery in interface SearchIndex
    • addRangeQuery

      public void addRangeQuery(AttributeValue av)
      RangeQuery 는 한 속성씩 추가 된다.
      Specified by:
      addRangeQuery in interface SearchIndex
    • addKeyWordQuery

      public void addKeyWordQuery(AttributeValue av)
      KeyWordQuery 는 한 속성씩 추가 된다.
      Specified by:
      addKeyWordQuery in interface SearchIndex
      Parameters:
      av - DOCUMENT ME!
    • addAttachmentQuery

      public void addAttachmentQuery(Integer[] ids, String text)
      Description copied from interface: SearchIndex
      Specify search criteria for attachments
      Specified by:
      addAttachmentQuery in interface SearchIndex
    • setSearcher

      public void setSearcher(int id)
      set Searcher Id and Personal Info
      Specified by:
      setSearcher in interface SearchIndex
      Parameters:
      id - searcher
    • getRelatedItems

      public BitSet getRelatedItems() throws TorqueException, IOException
      Description copied from interface: SearchIndex
      returns a BitSet of related item IDs sorted by relevance descending. Should return an empty/length=0 BitSet if search returns no results.
      Specified by:
      getRelatedItems in interface SearchIndex
      Returns:
      always empty bitSet
      Throws:
      TorqueException
      IOException - when searchEngine trouble
    • getIndexNames

      public String[] getIndexNames()
      Returns:
      검색할 index location (test/debug 용)
    • getModuleFilter

      public BitSet getModuleFilter()
      Returns:
      module filter (test/debug 용), null 이면 module 을 한정하지 않는다.
    • dispose

      public void dispose()
      검색 조건을 모두 지운다.