ISolrSearchEngineSchema.SearchOptions

Fore Syntax

SearchOptions: ISolrSearchOptions;

Fore.NET Syntax

SearchOptions: Prognoz.Platform.Interop.BISearch.ISolrSearchOptions;

Description

The SearchOptions property returns parameters used on data search.

Fore Example

It is supposed that the repository is set to work with search service based on Apache Solr. Add links to the BISearch, Fore, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    SharedParams: ISharedParams;
    SearchEngine: ISolrSearchEngineService;
    Schema: ISolrSearchEngineSchema;
    Options: ISolrSearchOptions;
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.SearchOptions;
    Options.Operator_ := LogicalOperator.Or_;
    Options.RelevanceImpactFormula := "sum(userDataDynamic, userWeight)";
    Options.UseSmartSearch := True;
    SearchEngine.Cores.Add("http://localhost:8080/solr-4.4.0/FreeDimensions_ru", SearchEngineTargetType.FreeDimensions, LocaleCodeID.Russian);
    //Save
    SharedParams.SearchEngine := SearchEngine;
    (SharedParams As IMetabaseObject).Save;
End Sub UserProc;

On executing the example, search settings will be determined in the repository: the operator that is used to merge words on search, impact formula on relativity will be determined and the search option by free dimensions will be activated. To index free dimensions, the Solr instance will be determined.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Along with the assemblies determined in the Fore example, also add a link to the System assembly.

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;
    Options: ISolrSearchOptions;
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.SearchOptions;
    Options.Operator := LogicalOperator.loOr;
    Options.RelevanceImpactFormula := "sum(userDataDynamic, userWeight)";
    Options.UseSmartSearch := True;
    SearchEngine.Cores.Add("http://localhost:8080/solr-4.4.0/FreeDimensions_ru", SearchEngineTargetType.settFreeDimensions, LocaleCodeID.lcidRussian);
    //Save
    SharedParams.SearchEngine := SearchEngine;
    (SharedParams As IMetabaseObject).Save();
End Sub;

See also:

ISolrSearchEngineSchema