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

SRCH-1754 update Elasticsearch initializer & client #128

Conversation

MothOnMars
Copy link
Contributor

@MothOnMars MothOnMars commented Nov 30, 2020

This is the first of several PRs into the release/elasticsearch_gems_1727 branch. I've broken up the changes largely to simplify the review process. This PR updates the Elasticsearch client initializer to avoid using the Elasticsearch::Persistence.client method, which is deprecated in the next version of the elasticsearch-persistence gem. That will still be in temporary use to set the persistence client (Elasticsearch::Persistence.client = ES.client) until I update the gems.

It also adds a couple of test helpers to DRY up the specs.

@MothOnMars
Copy link
Contributor Author

Closing temporarily to make a tweak.

@MothOnMars MothOnMars closed this Nov 30, 2020
@MothOnMars MothOnMars reopened this Nov 30, 2020
end

Elasticsearch::Persistence.client = ES.client
Copy link

Choose a reason for hiding this comment

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

Why is the assignment to Elasticsearch::Persistence.client necessary? Backwards compatibility for some code that this PR doesn't change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's for backwards compatibility. It sets the client for the persisted classes (Document and Collection), replicating the logic of the existing client assignment, but using the new ES.client method. That line is going to go away in a subsequent commit.

Copy link

@jmax315 jmax315 left a comment

Choose a reason for hiding this comment

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

Approved, with one request for information about a change.

Copy link
Contributor

@jmax-fearless jmax-fearless left a comment

Choose a reason for hiding this comment

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

Approved with a request for information about one bit.

@MothOnMars MothOnMars merged commit d48d37d into GSA:release/elasticsearch_gems_1727 Dec 2, 2020
@MothOnMars MothOnMars deleted the update_client_1754 branch December 2, 2020 17:58
MothOnMars added a commit that referenced this pull request Feb 25, 2021
…rch 7 (#131)

* SRCH-1754 update Elasticsearch initializer & client (#128)
* SRCH-1743 create repository classes (#130)
* SRCH-1755 upgrade elasticsearch gems to 6.x (#134)
* SRCH-1819 return total search hits as an integer (#138)
* SRCH-1818 set minimum_should_match to 1 in bool filter (#139)
* SRCH-1730 update templates (#137)
* SRCH-1820 add Elasticsearch & Kibana 7 to docker-compose.yml (#136)
* SRCH-1718 run specs against Elasticsearch 6 & 7 (#140)
* SRCH-1876 fix intermittent spec failures (#141)
- replace patron with typhoeus
- bump nokogiri
* SRCH-1854 set ID when deserializing (#142)
* SRCH-1822 placate Rubocop (#143)
@MyNameIsMissing MyNameIsMissing mentioned this pull request Feb 25, 2021
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.

3 participants