org.exoplatform.commons.api.search
Class SearchService

java.lang.Object
  extended by org.exoplatform.commons.api.search.SearchService

public abstract class SearchService
extends Object

Defines a Search API that a driver can implement, and provides the add/get methods to the connector.


Constructor Summary
SearchService()
           
 
Method Summary
 void addConnector(SearchServiceConnector connector)
          Adds a connector which is implemented by the Search API.
 LinkedList<SearchServiceConnector> getConnectors()
          Gets all current connectors.
abstract  Map<String,Collection<SearchResult>> search(SearchContext context, String query, Collection<String> sites, Collection<String> types, int offset, int limit, String sort, String order)
          Aggregates search results from all connectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchService

public SearchService()
Method Detail

getConnectors

public LinkedList<SearchServiceConnector> getConnectors()
Gets all current connectors.

Returns:
Connectors.

addConnector

public void addConnector(SearchServiceConnector connector)
Adds a connector which is implemented by the Search API.

Parameters:
connector - The connector to be added.

search

public abstract Map<String,Collection<SearchResult>> search(SearchContext context,
                                                            String query,
                                                            Collection<String> sites,
                                                            Collection<String> types,
                                                            int offset,
                                                            int limit,
                                                            String sort,
                                                            String order)
Aggregates search results from all connectors.

Parameters:
context - The search context.
query - The query statement.
sites - Specified sites where the search is performed (for example, Acme, or Intranet).
types - Specified types by which the search is performed (for example, people, discussion, event, task, wiki, activity, social, file, document).
offset - The start point from which the search results are returned.
limit - The limitation number of search results.
sort - The sorting criteria (title, relevancy and date).
order - The sorting order (ascending and descending).
Returns:
A map of connectors with search results.


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.