matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
702 stars 113 forks source link

EloquentHitsIteratorAggregate trait for properties. #281

Closed DavisPuciriuss closed 2 months ago

DavisPuciriuss commented 3 months ago

Added a trait, that sets _score and highlight from EloquentHitsIteratorAggregate. After adding the trait to your model, you can access '_score' and 'highlight' after a search was performed via 'getElasticsearchScore' and 'getElasticsearchHighlight' functions.

Any feedback appreciated.

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (8.x@304ff4a). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 8.x #281 +/- ## ====================================== Coverage ? 98.16% Complexity ? 266 ====================================== Files ? 41 Lines ? 816 Branches ? 0 ====================================== Hits ? 801 Misses ? 15 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

matchish commented 2 months ago

On comment with possible improvement(up to you) And plz update README.md and CHANGELOG.md https://github.com/matchish/laravel-scout-elasticsearch?tab=readme-ov-file#working-with-results

DavisPuciriuss commented 2 months ago

Updated README.md and CHANGELOG.md to include this change.