RemoveDocsByFieldName(Core: ISolrSearchEngineCore; FieldName: String; Values: Array): Boolean;
Core. Solr instance, which is under work.
FieldType. Field name, by which documents must be removed.
Values. Array of indexed values.
The RemoveDocsByFieldName method removes the Apach Solr documents linked to the specified field and where specified indexed values are stored.
The field name that is used to remove documents is case-sensitive.
The method returns True if removal was successful, and False if removal is impossible due to some reasons.
The list of the Solr instances can be obtained in the ISolrSearchEngineService.Cores property.
Sub UserProc;
Var
MB: IMetabase;
SharedParams: ISharedParams;
SearchEngine: ISolrSearchEngineService;
Core: ISolrSearchEngineCore;
Operations: ISolrOperations;
Arr: Array;
Begin
MB := MetabaseClass.Active;
SharedParams := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
SearchEngine := SharedParams.SearchEngine As ISolrSearchEngineService;
Core := SearchEngine.Cores.Item(0);
Arr := New Variant[1];
Arr[0] := "Cube";
Operations := New SolrOperations.Create;
Operations.RemoveDocsByFieldName(Core, "name", Arr);
End Sub UserProc;
On executing the example the Solr documents, which are linked with the name field and which contain the Cube indexed value, will be removed.
See also: