com.rapidtransform.core.search.lucene
Class CompassSearchService

java.lang.Object
  extended by com.rapidtransform.core.service.impl.ServiceImpl
      extended by com.rapidtransform.core.search.lucene.CompassSearchService
All Implemented Interfaces:
SearchService, Service, org.springframework.beans.factory.InitializingBean

public class CompassSearchService
extends ServiceImpl
implements SearchService, org.springframework.beans.factory.InitializingBean

Author:
Steve Werner

Constructor Summary
CompassSearchService()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.compass.core.Compass getCompass()
           
 org.compass.core.CompassTemplate getCompassTemplate()
           
 void index()
          Creates the search indexes.
 java.util.Collection<SearchResult> search(java.lang.String searchType, SearchCommand searchCommand)
          Searches the Lucene index for matches to the query in the CompassSearchCommand.
 void setCompass(org.compass.core.Compass compass)
           
 
Methods inherited from class com.rapidtransform.core.service.impl.ServiceImpl
getMessageSource, getSecurityService, setMessageSource, setSecurityService
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompassSearchService

public CompassSearchService()
Method Detail

getCompass

public org.compass.core.Compass getCompass()

setCompass

public void setCompass(org.compass.core.Compass compass)

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

getCompassTemplate

public org.compass.core.CompassTemplate getCompassTemplate()

search

public java.util.Collection<SearchResult> search(java.lang.String searchType,
                                                 SearchCommand searchCommand)
Searches the Lucene index for matches to the query in the CompassSearchCommand. If the results should be paginated, the pageSize and currentPage attributes must be set on the SearchCommand. If pageSize and currentPage are null, then the results will not be paged. The format for the query follows Lucene's query format. See Lucene documentation for details.

Specified by:
search in interface SearchService
Parameters:
searchType - The QName of the Meta Type that is being searched. If null, then all types will be searched.

index

public void index()
Creates the search indexes. If old search indexes exist, they are removed once the new indexes are created. No system down time is required to re-index since the new indexes will be swapped in for the old indexes by using the index locks.

Specified by:
index in interface SearchService