mixailshaulsky/elasticsearch-bundle
A Symfony bundle that integrates Elasticsearch into PHP applications, offering configuration and service wiring for the Elasticsearch client plus helpers for indexing documents and running search queries from Symfony services.
Update the dependency:
composer require <vendor>/<package>:^6.0.4
Confirm the installed version:
composer show <vendor>/<package>
Review the package’s service provider and configuration first. Look for:
php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider"Run the package’s test suite or a small local integration test before using the new float score behavior in production.
First use case: replace integer-only score handling in a ranking, matching, validation, or recommendation flow with float scores where finer ordering matters.
Example pattern:
$result = $scorer->score($subject);
// v6.0.4 supports float results
$score = (float) $result->score();
decimal rather than float when exact decimal behavior matters:
$table->decimal('score', 8, 4)->nullable();
For ephemeral ranking only, a PHP float is usually sufficient.$score = (float) $result->score();
Avoid repeated casting throughout views, jobs, and API resources.number_format($score, 2);
if (abs($score - $expected) < 0.0001) {
// treat as equal
}
return [
'score' => round($result->score(), 4),
];
$this->assertGreaterThan($low->score(), $high->score());
===, ==, or direct database equality against float scores unless you control precision and storage format.integer, decimal:2, or custom casts. An integer cast will discard the new fractional score.integer or numeric|max:100 may need adjustment. Prefer numeric and explicit bounds.logger()->debug('score result', [
'raw' => $result->score(),
'rounded' => round($result->score(), 4),
]);
How can I help you explore Laravel packages today?