Explorer
Explorer copied to clipboard
Add Custom Query Parameters
Hi there
I want to add custom query parameter in search function, as documented here https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html such as track_total_hits because it only return maximum 10000 record, I have to manually add this paramter to query builder. But there is no place to add in the ScoutSearchCommandBuilder
Can you add some custom Params after this
$query = new Query();
$query->setFields($this->fields);
$query->setSort($this->sort);
$query->setLimit($this->limit);
$query->setOffset($this->offset);
like + $query->setParams($this->params);
Regards Jack
Sure, that should be doable.
@Jeroen-G Thanks a lot, you are legend
@Jeroen-G Hello Jeroren, when the new version can be released? I am waiting for the new parameter input now.
Sorry, I have not yet started working on this.
Hi Jeroen, just wondering when the new feature will be released? I am awaiting for on the production. @Jeroen-G
Feel free to contribute 😄
I add #89 pull request.
the usage Model::search()->param("track_total_hits", true);
please approve it, and add new tag to publish
Hi @Jeroen-G I added my own fork, can't wait it for publishing, will merge back if next version has this feature
Custom query properties are now a thing in 3.5.0