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

Add the track_scores option to the query #417

Merged
merged 3 commits into from
Sep 28, 2016

Conversation

dmitry
Copy link
Contributor

@dmitry dmitry commented Aug 24, 2016

_score to be computed and tracked even when there are no _score in sort.

More here: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html

@dmitry
Copy link
Contributor Author

dmitry commented Aug 24, 2016

BTW: I would add somewhere in the readme line how to add unsupported criterias, like:

PlacesSearch.
  index.
  filter(filters).
  tap { |v| v.criteria.update_request_options(track_scores: true) }

Small remark: if it will be right after the index, criteria will be written into the index, and will be always added into the resulting JSON query, that's why it should go after the filter to add values into the duplicated criteria.

@pyromaniac
Copy link
Contributor

Hm, as for remark - you probably can do PlacesIndex.all and then this tap will be chained to the query instance.

Can you add specs for this so I could merge it, please?

Great contribution, thanks!

@dmitry
Copy link
Contributor Author

dmitry commented Sep 15, 2016

@pyromaniac tests were added.

@dmitry
Copy link
Contributor Author

dmitry commented Sep 26, 2016

@pyromaniac please merge :)

@pyromaniac
Copy link
Contributor

Oh boy, I missed this. Can you please fix rubocop offences and I'll merge it right away. Sorry for the delay.

@dmitry
Copy link
Contributor Author

dmitry commented Sep 27, 2016

@pyromaniac where do I can see rubocop offences?

@pyromaniac
Copy link
Contributor

just run rubocop in the project directory

`_score` to be computed and tracked even when there are no `_score` in sort.
@dmitry
Copy link
Contributor Author

dmitry commented Sep 27, 2016

@pyromaniac right, haven't noticed my master isn't synced with origin master

@pyromaniac
Copy link
Contributor

Perfect, thanks!

@pyromaniac pyromaniac merged commit 13d0baf into toptal:master Sep 28, 2016
@dmitry dmitry deleted the add-track-scores branch September 28, 2016 07:16
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.

2 participants