ISolrOperations.ClearAll

Syntax

ClearAll(Core: 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.

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.

See also:

ISolrOperations