org.exoplatform.commons.api.search
Class SearchService

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

public abstract class SearchService
extends Object

These class defines the Search API that a driver can implement and provides add/get methods on the connector.


Constructor Summary
SearchService()
           
 
Method Summary
 void addConnector(SearchServiceConnector connector)
          Add a connector that implemented search API
 LinkedList<SearchServiceConnector> getConnectors()
          Get all connectors currently
abstract  Map<String,Collection<SearchResult>> search(SearchContext context, String query, Collection<String> sites, Collection<String> types, int offset, int limit, String sort, String order)
          This search method 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()
Get all connectors currently

Returns:
Collection of connectors

addConnector

public void addConnector(SearchServiceConnector connector)
Add a connector that implemented search API

Parameters:
connector -

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)
This search method aggregates search results from all connectors

Parameters:
context - Search context
query - The user-input query to search for
sites - Search on these specified sites only (e.g acme, intranet...)
types - Search for these specified content types only (e.g people, discussion, event, task, wiki, activity, social, file, document...)
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 map of connector with their search result


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