ISolrOperations.ClearAll

Fore Syntax

ClearAll(Core: ISolrSearchEngineCore): Boolean;

Fore.NET Syntax

ClearAll(Core: Prognoz.Platform.Interop.BISearch.ISolrSearchEngineCore): Boolean;

Parameters

Core. The Solr instance, for which indexed documents must be cleared.

Description

The ClearAll method deletes all documents with indexed data for the specified Solr instance.

Comments

The list of the Solr instances can be obtained in the ISolrSearchEngineService.Cores property.

Fore Example

Sub UserProc;
Var
    MB: IMetabase;
    SharedParams: ISharedParams;
    SearchEngine: ISolrSearchEngineService;
    Core: ISolrSearchEngineCore;
    Operations: ISolrOperations;
Begin
    MB := MetabaseClass.Active;
    //Get search and indexing parameters
    SharedParams := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Core := SearchEngine.Cores.Item(0);
    Operations := New SolrOperations.Create;
    Operations.ClearAll(Core);
End Sub UserProc;

On executing the example the search index for the specified Solr instance will be cleared.

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;
    Core: ISolrSearchEngineCore;
    Operations: ISolrOperations = New SolrOperationsClass();
Begin
    MB := Params.Metabase;
    //Search and indexing parameters specified for repository
    SharedParams := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Bind() As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Core := SearchEngine.Cores.Item(0);
    Operations.ClearAll(Core);
End Sub;

See also:

ISolrOperations