Keys: Array;
The Keys property determines key array of repository indexed objects.
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.
Executing the example requires that the repository contains objects with the REGIONS_DATA and CITY_DATA identifiers. 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];
ObjectKeys: 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
ObjectKeys := New UInteger[2];
ObjectKeys[0] := MB.GetObjectKeyById("REGIONS_DATA");
ObjectKeys[1] := MB.GetObjectKeyById("CITY_DATA");
ImportContext.Keys := ObjectKeys;
//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 be determined and indexed objects will be set. After determining all settings object metadata will be indexed.
See also: