algoliasearch-rails
algoliasearch-rails copied to clipboard
How to set a sort-by attribute?
Using the customRanking option, I'm able to add attributes to rank by to break ties in the textual relevance. However, I'm not able to add attributes to sort by BEFORE applying textual relevance (the green "SORT-BY" field in the web UI below). How can I go about adding those with the algolia-rails gem? Thanks!
I'm also trying to do that, did you find a way?
are you looking for this? https://github.com/algolia/algoliasearch-rails/issues/237
Thanks @jinsoocha
Maybe there could be a shortcut for the configuration, something like:
algoliasearch ... do
# ....
sortBy 'asc(start_datetime_i)'
end
that could be the same as doing:
algoliasearch ... do
# ....
ranking ['asc(start_datetime_i)', 'typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom']
end