Build and Migration States
ElasticLens tracks the state of every build and migration in Elasticsearch. You can query these models directly.
IndexableBuild Model
Section titled “IndexableBuild Model”Tracks the state of each index build, giving you visibility into the sync process.
Fields
/*** PDPhilip\ElasticLens\Models\IndexableBuild******Fields******** @property string $model // The base model being indexed.* @property string $model_id // The ID of the base model.* @property string $index_model // The corresponding index model.* @property string $last_source // The last source of the build state.* @property IndexableStateType $state // The current state of the index build.* @property array $state_data // Additional data related to the build state.* @property array $logs // Logs of the indexing process.* @property Carbon $created_at // Timestamp of when the build state was created.* @property Carbon $updated_at // Timestamp of the last update to the build state.******Attributes******** @property-read string $state_name // The name of the current state.* @property-read string $state_color // The color associated with the current state.**/Built-in methods:
use PDPhilip\ElasticLens\Models\IndexableBuild;
IndexableBuild::returnState($model, $modelId, $indexModel);IndexableBuild::countModelErrors($indexModel);IndexableBuild::countModelRecords($indexModel);IndexableMigrationLog Model
Section titled “IndexableMigrationLog Model”Tracks every migration run against an Index Model, with versioning.
Fields
/*** PDPhilip\ElasticLens\Models\IndexableBuild******Fields******** @property string $index_model // The migrated Index Model* @property IndexableMigrationLogState $state // State of the migration* @property array $map // Migration map that was passed to Elasticsearch.* @property int $version_major // Major version of the indexing process.* @property int $version_minor // Minor version of the indexing process.* @property Carbon $created_at // Timestamp of when the migration was created.******Attributes******** @property-read string $version // Parsed version ex v2.03* @property-read string $state_name // Current state name.* @property-read string $state_color // Color representing the current state..**/Built-in methods:
use PDPhilip\ElasticLens\Models\IndexableMigrationLog;
IndexableMigrationLog::getLatestVersion($indexModel);IndexableMigrationLog::getLatestMigration($indexModel);