IMbObjectsImportContext.ContainerKeys

Fore.NET Syntax

ContainerKeys: Array;

Description

The ContainerKeys property determines array of repository objects for which it is necessary to index all child elements.

Fore Example

IMPORTANT. Because of the existing features of the Fore language implementation and use of multi-thread mode on indexing, indexing with code on the Fore language is not supported. Develop on the Fore.NET language.

Fore.NET Example

Executing the example requires that the repository contains folder with the F_CUBES identifier where cubes are stored and the F_TSDB folder where time series databases are stored. In the repository settings for indexing and search in Russian are determined.

Imports Prognoz.Platform.Interop.BISearch;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    SharedParams: ISharedParams;
    SearchEngine: ISolrSearchEngineService;
    Schema: ISolrSearchEngineSchema;
    ImportExecutor: IImportExecutor;
    ImportContext: IMbObjectsImportContext;
    SolrContext: ISolrImportContext;
    Locales: Array = New Integer[1] = [LocaleCodeID.lcidRussian As Integer];
    Containers: Array Of UInteger;
Begin
    MB := Params.Metabase;
    //Parameters of search and indexing set for repository
    SharedParams := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Bind() As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Schema := SearchEngine.SearchEngineSchema As ISolrSearchEngineSchema;
    //Indexing parameters
    ImportExecutor := Schema.ImportExecutor[SearchEngineTargetType.settMbObject];
    ImportContext := ImportExecutor.CreateContext() As IMbObjectsImportContext;
    SolrContext := ImportContext As ISolrImportContext;
    SolrContext.CleanType := SolrImportCleanType.sictNone;
    SolrContext.Locales := Locales;
    //Objects being indexed
    Containers := New UInteger[2];
    Containers[0] := MB.GetObjectKeyById("F_CUBES");
    Containers[1] := MB.GetObjectKeyById("F_TSDB");
    ImportContext.ContainerKeys := Containers;
    //Indexing
    ImportExecutor.Import(ImportContext);
End Sub;

On executing the example the context required for repository objects metadata indexing will be created. In context settings the language used for indexing will specified and the folders for which child objects it is necessary to index metadata will be set. After determination of all settings the indexing will be executed.

See also:

IMbObjectsImportContext