Indexing

After getting access to the object that executes indexing, prepare a context with indexing settings. To create a context, use the IImportExecutor.CreateContext method. Depending on what will be indexed (data source structures or repository object metadata), cast method result to one of two interfaces: ISourceDataImportContext and IMbObjectsImportContext. To specify parameters of the indexing process execution, one can also cast the result of the IImportExecutor.CreateContext method to the ISolrImportContext interface.

Data Source Indexing

Indexed objects can be set in two ways: in the ContainerKeys property specify a key array of container objects where data sources are stored or add required sources to the SourceInfos collection and determine specific indexing settings for it. When the ContainerKeys property is used, all sources are indexed with default parameters (default display version is used, free dimensions are absent (except for calendar one), maximum selection is applied for dimensions).

After all indexed sources are specified, send the configured context to the IImportExecutor.Import method. On executing the method the required documents are generated, which will be sent for further processing and storing in the Apache Solr. On indexing the Solr instances corresponding to the specified purpose (the purpose is specified in the input parameter of the IImportExecutor.CreateContext method) and to the languages (specified in the ISolrImportContext.Locales property) are used automatically.

Indexing of Repository Objects Metadata

Several ways can be used to determine repository objects, for which it is necessary to index metadata:

After specifying required objects, send the configured context to the IImportExecutor.Import method. On executing the method the required documents are generated, which will be sent for further processing and storing in the Apache Solr. On indexing the Solr instances corresponding to the specified purpose (the purpose is specified in the input parameter of the IImportExecutor.CreateContext method) and to the languages (specified in the ISolrImportContext.Locales property) are used automatically.

See also:

Introduction