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 it is necessary to clear indexed documents.

Description

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

Comments

List of the Solr instances can be get 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;
    //Parameters of search and indexing set 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