-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only shows the full message when the user have configured the settings for it #2140
Only shows the full message when the user have configured the settings for it #2140
Comments
Hi @brunoocasali, I find this type of message in this case also clearer! |
@gmourier So you like the new message idea? |
@MarinPostma Yes! I think it guides the user better in this case. 👌 |
Re-opening since it's still not fixed on Meilisearch side. |
Don't forget to add the same variant on |
Specified here meilisearch/specifications#125 |
468: Add a new error message when the filterableAttributes are empty r=Kerollmops a=brunoocasali Fixes meilisearch/meilisearch#2140 Is there a good way to reduce de duplication here? Maybe adding a shared function? I don't know the best and idiomatic way to do that, I appreciate any tip! Another doubt is related to the duplication of the calling: ```rs // filter.rs:373 FilterError::AttributeNotFilterable { attribute, filterable: filterable_fields.into_iter().collect::<Vec<_>>().join(" "), }, ``` and ```rs // filter.rs:424 return Err(point[0].as_external_error(FilterError::AttributeNotFilterable { attribute: "_geo", filterable: filterable_fields.into_iter().collect::<Vec<_>>().join(" "), }))?; ``` I think we could make the `filterable_fields.into_iter().collect::<Vec<_>>().join(" ")` directly into the error handling like the sortable error. I made it into the last commit, if this is something to avoid, let me know and I can remove it :) Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Reopening since it's not fixed on meilisearch's side but only on milli's side |
Milli was bumped in #2244, with milli v0.24.0 containing the required change for the new error message. We can close this issue. The change will be effective in v0.27.0. |
Describe the bug
When I provide a search request with a sort option, I should receive the error with the available sortable attributes but I'm getting an empty list:
My request:
GET http://localhost:7700/indexes/rails_e661e74611d4d7b8_Color_development/search?sort=name:asc
My index settings:
I know that I didn’t configure the
sortableAttributes
, so the question I make is, should we receive a different message? Or is ok to keep the current behavior? Because when I read it the first time, I really thought that something was wrong on my end.An idea could be having a conditional to show up when the user doesn't have any sortable attributes configured.
I've spotted the code here: https://github.com/meilisearch/milli/blob/8dff08d772db7ee2bccfed4a75b943ec8be455a2/milli/src/error.rs#L254 but I wasn’t sure if I need to post the issue here or in
milli
repo, please let me know :DMeilisearch version: v0.25.2
Additional context
Running in the dockerized environment (using the official docker image)
TODO
valid_fields
is empty milli#461filterableAttributes
on Milli's sideThe text was updated successfully, but these errors were encountered: