FillValues(MbObject: IMetabaseObject; Values: ISolrFieldValues);
FillValues(MbObject: Prognoz.Platform.Interop.Metabase.IMetabaseObject; Values: IPrognoz.Platform.Interop.BISearch.ISolrFieldValues);
MbObject. Data source which is being indexed currently.
Values. Collection of custom fields values which will be sent for indexation.
The FillValues method forms documents for custom fields indexing according to specified parameters.
The FillValues method should be re-defined in custom class. In the method it is necessary to determine the code which will fill in values of custom fields in the Values collection. The method will be performed for each object being indexed, the object will be available in the MbObject parameter.
Class CSolrImportCustomValues: Object, ISolrImportCustomValues
Sub FillValues(MbObject: IMetabaseObject; Values: ISolrFieldValues);
Begin
//Determine custom fields values for the object with specified key
If MbObject.Key = 19815 Then
Values.FindById("TAG", SearchEngineTargetType.SourceData).Value := "...";
End If;
//If the object class corresponds to the table dictionary, the objects metadata is indexed
If MbObject.ClassId = MetabaseObjectClass.KE_CLASS_STDDIM Then
Values.FindById("COMMENTS", SearchEngineTargetType.MbObject).Value := "...";
End If;
End Sub FillValues;
End Class CSolrImportCustomValues;
The example is a macros containing implementation of the method which fills in custom fields values on indexing. The method is performed for each object being indexed, in the method code the check is executed by key and object class. Depending on executed condition, different custom fields are filled in.
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.Metabase;
Public Class CSolrImportCustomValues: ISolrImportCustomValues
Public Sub FillValues(MbObject: IMetabaseObject; Values: ISolrFieldValues);
Begin
//Determine custom fields values for the object with specified key
If MbObject.Key = 19815 Then
Values.FindById("TAG", SearchEngineTargetType.settSourceData).Value := "...";
End If;
//If object class corresponds to the table dictionary, objects metadata is indexed
If MbObject.ClassId = MetabaseObjectClass.KE_CLASS_STDDIM As Integer Then
Values.FindById("COMMENTS", SearchEngineTargetType.settMbObject).Value := "...";
End If;
End Sub FillValues;
End Class;
See also: