-
Notifications
You must be signed in to change notification settings - Fork 244
Option to specify different search methods #38
Comments
same here, I do want to port some custom sollution to Scount. what I want now, is sort like this: 'sort' => [
[
'created_at' => [
'order' => 'desc',
],
'id' => [
'order' => 'desc',
],
],
], is there any option to achieve this at the moment? |
It's a bit tricky passing parameters to the engine, because one has to adhere to the Scout engine base class. I have made some changes to the query and filtering, which I think has made the search return better results, and faster. But nothing on sorting, yet... |
@huglester You could just fork it and make your own special implementation of course. |
@ErickTamayo Hey, I've forked and made some changes to the search query which I think returns much better results, faster.
I've also added a filter to remove results which is not present in the instances of the given model, like the Algolia engine has. That solved issue #36. Now... The changes I have made to the query will produce different search results, which may produce unwanted results for some. But I think it's a better way of searching. Will you be accepting a PR? Update 13.feb: I've made the search method configurable in the scout config, and overridable within search searchable model. |
Let's hope we will be able to solve this issue ar 'ELasticsearch' level. |
I have added the ability to define different search types in the config file, or override them like this:
Using a ElasticSearchable trait, instead of |
Wow. As for now I think this is exactly what is needed! SO it does support this 'fluent' syntax like: where('is_published', true)? |
@huglester The I'm planning to submit a PR after I've done some more testing. |
I'd like to have the option of using different search/sorting methods for different document types. I'm looking at overriding or expanding the
performSearch
method.What would be the best way to accomplish this? Any ideas or pointers to get me started on a possible pull request?
Search methods: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-common-terms-query.html
The text was updated successfully, but these errors were encountered: