IMbObjectsImportContext.ContainerKeys

Fore.NET Syntax

ContainerKeys: Array;

Description

The ContainerKeys property determines an array of repository objects, for which all child elements must be indexed.

Fore Example

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

Fore.NET Example

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

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;
    //Search and indexing parameters specified 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;
    //Indexed objects
    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. The language used for indexing and the folders, which child objects metadata must be indexed, will be determined in the settings. After all settings are determined, indexing will be executed.

See also:

IMbObjectsImportContext