Skip to content
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

Fixes #6899 - Remove name_sort field #7567

Merged
merged 9 commits into from Feb 16, 2018
Merged

Fixes #6899 - Remove name_sort field #7567

merged 9 commits into from Feb 16, 2018

Conversation

seanprashad
Copy link
Contributor

@seanprashad seanprashad commented Feb 14, 2018

Fixes #6899:

  • Changed the default field that is being used in SortingFilter to name.raw
  • Removed name_sort from addons.indexers

'is_new': {'type': 'boolean', 'index': False},
'textcolor': {'type': 'keyword', 'index': False},
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you removed too much, the issue was just about removing name_sort, the persona property needs to stay :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that heads up! Just gotta figure out what tests are failing for Travis now

@diox
Copy link
Member

diox commented Feb 15, 2018

Hey @seanprashad, just wanted to say I've watched the video you posted about your thought process regarding this issue and it was very cool, keep up the good work! You're close to finishing this PR, only a couple test failures left that were found by travis.

While you're at it, could you please remove '*_sort' from AddonIndexer's hidden_fields in src/olympia/addons/indexers.py ? The purpose of that variable is to list the fields we don't need to fetch from ElasticSearch when making a search query (making the result smaller in size, improving performance), and once name_sort is gone we should not have any other fields that match this '*_sort' rule, so we no longer need it.

@seanprashad
Copy link
Contributor Author

Thank you so much @diox - It definitely means a lot 😄 ! I've gotten a tiny bit closer tonight with Travis only complaining about a different assertion. This one is a bit harder for me to interpret but I think it's not receiving the correct value in both arrays because sorting is not done - what do you think?

@diox
Copy link
Member

diox commented Feb 16, 2018

That test indicates that there is more work to be done :) Looks like it's legitimately broken because the searching for addons and sorting by name is broken in that particular area of the code. There are 3 more occurrences of name_sort in src/olympia/search/views.py, and 2 of them need to be changed: the one in _personas() and the one in search().

(The reason the one in _collections() should be not changed is that searching for collections uses a different indexer, in src/olympia/bandwagon/indexers.py, and that one was not updated to switch to name.raw - it's still using name_sort only. Not worth fixing right now)

@seanprashad
Copy link
Contributor Author

Thank you @diox for those final tidbits of guidance! It looks like TravisCI is giving us the green light to merge - did you want me to squash any of my commits together or is it fine with how it currently is?

@diox
Copy link
Member

diox commented Feb 16, 2018

That looks good, thanks. I'll just squash it through github, no need to rebase it yourself.

@diox diox merged commit 2ee286d into mozilla:master Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants