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

Fix search error when ElasticSearch is enabled but not available #11954

Merged
merged 3 commits into from Sep 26, 2019
Merged

Fix search error when ElasticSearch is enabled but not available #11954

merged 3 commits into from Sep 26, 2019

Conversation

tribela
Copy link
Contributor

@tribela tribela commented Sep 25, 2019

Like #9654, It fallback to database search when ES is not available.

from_database
end
results = from_elasticsearch if Chewy.enabled?
results = from_database if results.nil?
Copy link
Member

Choose a reason for hiding this comment

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

OK, just write it like results ||= from_database

@Gargron Gargron changed the title Fallback to Database search when ES not available Fix search error when ElasticSearch is enabled but not available Sep 26, 2019
@Gargron Gargron merged commit 00d7bdc into mastodon:master Sep 26, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
…todon#11954)

* Fallback to Database search when ES not available

* Prevent double work if ES gives 0 result

* Apply suggestion from code review
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

2 participants