scout-elasticsearch-driver icon indicating copy to clipboard operation
scout-elasticsearch-driver copied to clipboard

Update Highlight.php

Open Surt opened this issue 6 years ago • 2 comments

https://github.com/babenkoivan/scout-elasticsearch-driver/issues/152

Surt avatar Feb 04 '19 18:02 Surt

Hi @Surt,

Could you please describe your changes and reasons?

Also would be greate to have tests for your changes.

iget-esoares avatar Mar 24 '19 15:03 iget-esoares

Hi @iget-esoares it was just a quick proposal. It adds \ArrayAccess, \Iterator to the Highlight results object. Now it is possible to transverse throught the hightlighted results with a foreach. As well as accesing the results as it was an Array.

I'm not having the necesary time right now. I will try to make an adecuate pull request someday if nobody take it from here.

By the way, looking again i see it could be done easily just setting $highlight property as public ....

Surt avatar Mar 25 '19 14:03 Surt