public final class SearchServiceFactory
An factory that creates default implementation of SearchService.
SearchService search = SearchServiceFactory.getSearchService();
Optionally, you may pass a SearchServiceConfig instance to customize the search service. e.g, setting deadline and namespace:
SearchServiceFactory.getSearchService(
SearchServiceConfig.newBuilder().setDeadline(10.0).setNamespace("acme").build())
Static Methods
getSearchService()
public static SearchService getSearchService()
Equivalent to getSearchService(SearchServiceConfig.newBuilder().build()).
Returns | |
---|---|
Type | Description |
SearchService |
getSearchService(SearchServiceConfig config)
public static SearchService getSearchService(SearchServiceConfig config)
Returns an instance of the SearchService with the given config.
Parameter | |
---|---|
Name | Description |
config |
SearchServiceConfig a SearchServiceConfig instance that describes the requested search service. If no namespace provided in config, NamespaceManager.get() will be used. |
Returns | |
---|---|
Type | Description |
SearchService |
the default implementation of SearchService. |
getSearchService(String namespace) (deprecated)
public static SearchService getSearchService(String namespace)
Deprecated. Use SearchServiceFactory#getSearchService(SearchServiceConfig)
Returns an instance of the SearchService. The instance will exist in the user provided namespace. The namespace must be valid, as per NamespaceManager#validateNamespace(String) method.
Parameter | |
---|---|
Name | Description |
namespace |
String a namespace to be assigned to the returned search service. |
Returns | |
---|---|
Type | Description |
SearchService |
the default implementation of SearchService. |