ISolrSearchEngineSchema.SearchOptions

Syntax

SearchOptions: ISolrSearchOptions;

Description

The SearchOptions property returns parameters used on data search.

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.

See also:

ISolrSearchEngineSchema