ISolrSearchEngineSchema.ImportProcessOptions

Fore Syntax

ImportProcessOptions: ISolrImportProcessOptions;

Fore.NET Syntax

ImportProcessOptions: Prognoz.Platform.Interop.BISearch.ISolrImportProcessOptions;

Description

The ImportProcessOptions property returns parameters used on indexing of data or metadata.

Fore Example

Executing the example requires that the repository contains an assembly with the CUSTOMVALUES identifier (for the Fore.NET example - .NET assembly named CUSTOMVALUESNET). The assembly implements the CSolrImportCustomValues class used to fill in values of custom fields on indexing.The class must contain implementation of the ISolrImportCustomValues interface. Add links to the BISearch, Fore, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    SharedParams: ISharedParams;
    SearchEngine: ISolrSearchEngineService;
    Schema: ISolrSearchEngineSchema;
    Options: ISolrImportProcessOptions;
    Binding: ISolrImportCustomBinding;
Begin
    MB := MetabaseClass.Active;
    SharedParams := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Edit As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Schema := SearchEngine.SearchEngineSchema As ISolrSearchEngineSchema;
    //Change settings
    Options := Schema.ImportProcessOptions;
    Options.BlockSize := 1000;
    Options.QueryMaxSize := 1048576;
    Options.ThreadsCount := 4;
    Options.NeedSmartSearch := True;
    Binding := Options.ImportBinding;
    Binding.Assembly := MB.ItemById("CUSTOMVALUES");
    Binding.ClassName := "CSolrImportCustomValues";
    //Save
    SharedParams.SearchEngine := SearchEngine;
    (SharedParams As IMetabaseObject).Save;
End Sub UserProc;

On executing the example indexing settings will be determined in the repository: values used on matrix building will be determined, maximum size of the created XML document, which will be sent for indexing to the Apache Solr server, will be set and the assembly and class that are used to process custom fields are also determined.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.BISearch;
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;
    Options: ISolrImportProcessOptions;
    Binding: ISolrImportCustomBinding;
Begin
    MB := Params.Metabase;
    SharedParams := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Edit() As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Schema := SearchEngine.SearchEngineSchema As ISolrSearchEngineSchema;
    //Change settings
    Options := Schema.ImportProcessOptions;
    Options.BlockSize := 1000;
    Options.QueryMaxSize := 1048576;
    Options.ThreadsCount := 4;
    Options.NeedSmartSearch := True;
    Binding := Options.ImportBinding;
    Binding.Assembly := MB.ItemById["CUSTOMVALUESNET"];
    Binding.ClassName := "CSolrImportCustomValues";
    //Save
    SharedParams.SearchEngine := SearchEngine;
    (SharedParams As IMetabaseObject).Save();
End Sub;

See also:

ISolrSearchEngineSchema