Vinny
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Yep, copy pasted the same exact code, same issues.
Regardless though, I was hoping it would serve as just a dropdown instead of modal with a dropdown.
I'll mark this as solved unless you perhaps know a way to have the button show a dropdown instead of opening a modal.
24 replies
Table Builder + Scout: Search Result Order
As I mentioned above, I have some other logic in the
applySearchToTableQuery()
method now because I've already "hacked" around the issue. The snippet I posted for ordering is just my workaround solution. Any other resolutions are appreciated!11 replies
Table Builder + Scout: Search Result Order
It has evolved quite a bit since then. But I will share what I discovered.
At that point I was using the exact version of
applySearchToTableQuery()
from the filament docs. (I am pasting the one from the docs here because the one I have now is vastly different because I have worked around the issue already. see below)
Essentially if I do Post::search($q)->get()
I get all the results in order because (from what I gathered, I could be wrong) scout handles the reordering internally.
To compare, I did Post::query()->whereIn('id', Post::search('whatever')->keys())
and the order was messed up. So, while scout does use whereIn
internally like the docs say, it handles reordering based on search relevancy internally also.
To work around the messed up order, I appended a manual "ORDER BY" at the end of my query in applySearchToTableQuery()
to order it based on the search keys that scout returns.
In MySQL, I believe you can use FIELD()
to achieve the same effect but I use SQL Server so I had to go with this approach. It's a bit dirty but I couldn't figure out any other way to preserve search relevancy as returned by meilisearch.11 replies