org.exoplatform.commons.api.search
Class SearchServiceConnector

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.commons.api.search.SearchServiceConnector
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public abstract class SearchServiceConnector
extends org.exoplatform.container.component.BaseComponentPlugin

This abstract class is extended by the SearchService connectors which provide search result for a specific content type


Field Summary
 
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name
 
Constructor Summary
SearchServiceConnector(org.exoplatform.container.xml.InitParams initParams)
          Constructor is default that other connecters must implement by this way
 
Method Summary
 String getDisplayName()
          Get display name
 String getSearchType()
          Get search type
abstract  Collection<SearchResult> search(SearchContext context, String query, Collection<String> sites, int offset, int limit, String sort, String order)
          The connectors must implement this search method, with the following parameters and return a collection of SearchResult
 void setDisplayName(String displayName)
          Set display name
 void setSearchType(String searchType)
          Set search type
 
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchServiceConnector

public SearchServiceConnector(org.exoplatform.container.xml.InitParams initParams)
Constructor is default that other connecters must implement by this way

Parameters:
initParams - parameters are initialized from configuration
Method Detail

getSearchType

public String getSearchType()
Get search type

Returns:
String

setSearchType

public void setSearchType(String searchType)
Set search type

Parameters:
searchType -

getDisplayName

public String getDisplayName()
Get display name

Returns:
String

setDisplayName

public void setDisplayName(String displayName)
Set display name

Parameters:
displayName -

search

public abstract Collection<SearchResult> search(SearchContext context,
                                                String query,
                                                Collection<String> sites,
                                                int offset,
                                                int limit,
                                                String sort,
                                                String order)
The connectors must implement this search method, with the following parameters and return a collection of SearchResult

Parameters:
context - Search context
query - The user-input query to search for
sites - Search on these specified sites only (e.g acme, intranet...)
offset - Start offset of the result set
limit - Maximum size of the result set
sort - The field to sort the result set
order - Sort order (ASC, DESC)
Returns:
a collection of SearchResult


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.