laravelelasticsearchlaravel-scout

How to set track_total_hits in Elasticsearch using Laravel Scout?


I have been using https://github.com/babenkoivan/scout-elasticsearch-driver and I am looking to set "track_total_hits" to true so I can get the total results.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-track-total-hits

I am not sure how to get an array value to that point?

Thanks.


Solution

  • The package you are using is not implementing the track_total_hits (a search on the repo content will confirm that). You can, however, fork the repo and add the functionality yourself if required.