Class SearchServiceFactory (2.0.0)

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())
 

Inheritance

java.lang.Object > SearchServiceFactory

Static Methods

getSearchService()

public static SearchService getSearchService()
Returns
TypeDescription
SearchService

getSearchService(SearchServiceConfig config)

public static SearchService getSearchService(SearchServiceConfig config)

Returns an instance of the SearchService with the given config.

Parameter
NameDescription
configSearchServiceConfig

a SearchServiceConfig instance that describes the requested search service. If no namespace provided in config, NamespaceManager.get() will be used.

Returns
TypeDescription
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
NameDescription
namespaceString

a namespace to be assigned to the returned search service.

Returns
TypeDescription
SearchService

the default implementation of SearchService.