ISolrSearchEngineCores.Add

Syntax

Add(Address: String; Type: SearchEngineTargetType; Locale: LocaleCodeID): ISolrSearchEngineCore;

Parameters

Address. URL of the Solr instance.

Type. Solr instance purpose.

Locale. Solr instance is intended to work with the language having this identifier.

Description

The Add method adds a Solr instance according to the specified parameters.

Comments

The URL determined in the Address parameter is case-sensitive.

Example

Sub UserProc;
Var
    MB: IMetabase;
    SharedParams: ISharedParams;
    SearchEngine: ISolrSearchEngineService;
    Cores: ISolrSearchEngineCores;
Begin
    MB := MetabaseClass.Active;
    //Search and indexing parameters specified for repository
    SharedParams := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Edit As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Cores := SearchEngine.Cores;
    //Add a Solr instance
    Cores.Add("http://localhost:8080/solr-4.4.0/SourceData_ru", SearchEngineTargetType.SourceData, LocaleCodeID.Russian);
    //Save
    SharedParams.SearchEngine := SearchEngine;
    (SharedParams As IMetabaseObject).Save;
End Sub UserProc;

On executing the example a new Solr instance that is used to index and search information about elements of the dimensions, which create data slices in Russian, will be added in the search settings.

See also:

ISolrSearchEngineCores