ISolrOperations.GetOverview

Fore Syntax

GetOverview(Core: ISolrSearchEngineCore): ISolrCoreInfo;

Fore.NET Syntax

GetOverview(Core: Prognoz.Platform.Interop.BISearch.ISolrSearchEngineCore): Prognoz.Platform.Interop.BISearch.ISolrCoreInfo;

Parameters

Core. The Solr instance, information about which must be obtained.

Description

The GetOverview method extracts information about the specified Solr instance.

Comments

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

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;
    Core: ISolrSearchEngineCore;
    Operations: ISolrOperations;
    Info: ISolrCoreInfo;
Begin
    MB := MetabaseClass.Active;
    //Search and indexing parameters specified for repository
    SharedParams := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
    Core := SearchEngine.Cores.Item(0);
    Operations := New SolrOperations.Create;
    //Get information about Solr instance
    Info := Operations.GetOverview(Core);
    If Info.HasDeletions Then
        Debug.WriteLine("Number of removed documents: " + Info.DeletedDocs.ToString);
    End If;
    Debug.WriteLine("Date or time of the last changes: " + Info.LastModified.ToString);
    Debug.WriteLine("Current or maximum number of documents: " + Info.NumDocs.ToString + "/" + Info.MaxDoc.ToString);
End Sub UserProc;

On executing the example information about the specified Solr instance will be obtained. Information will be displayed in the development environment console.

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();
    Info: ISolrCoreInfo;
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];
    //Get information about Solr instance
    Info := Operations.GetOverview(Core);
    If Info.HasDeletions Then
        System.Diagnostics.Debug.WriteLine("Number of removed documents: " + Info.DeletedDocs.ToString());
    End If;
    System.Diagnostics.Debug.WriteLine("Date or time of the last changes: " + Info.LastModified.ToString());
    System.Diagnostics.Debug.WriteLine("Current or maximum number of documents: " + Info.NumDocs.ToString() + "/" + Info.MaxDoc.ToString());
End Sub;

See also:

ISolrOperations