Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
AO3-5221: Bookmarkable indexing #3186
Conversation
WendyBeth
and others
added some commits
Oct 20, 2017
| + indexers = klass.new.indexers | ||
| + end | ||
| + indexers.each do |indexer| | ||
| + self.new(indexer, priority).enqueue_ids(ids) |
| + def document_id(id) | ||
| + "#{id}-#{klass.underscore}" | ||
| + end | ||
| + |
| + body: document(object) | ||
| + } | ||
| + if respond_to?(:parent_id) | ||
| + info.merge!(routing: parent_id(object)) |
houndci-bot
Nov 29, 2017
Use info[:routing] = parent_id(object) instead of info.merge!(routing: parent_id(object)).
| + if respond_to?(:parent_id) | ||
| + info.merge!(routing: parent_id(object)) | ||
| + end | ||
| + $new_elasticsearch.index(info) |
| + def document_id(id) | ||
| + id | ||
| + end | ||
| + |
| - routing: "#{self.bookmarkable_type}-#{self.bookmarkable_id}" | ||
| - ) | ||
| + responses = [] | ||
| + self.indexers.each do |indexer| |
sarken
added
the
Awaiting review
label
Nov 29, 2017
elzj
added
the
Priority: Broken on Test (High)
label
Nov 29, 2017
| + if klass.to_s =~ /Indexer/ | ||
| + indexers = [klass] | ||
| + else | ||
| + klass = klass.constantize if klass.respond_to?(:constantize) |
| + if respond_to?(:parent_id) | ||
| + info.merge!(routing: parent_id(object)) | ||
| + end | ||
| + $new_elasticsearch.index(info) |
elzj
added some commits
Nov 30, 2017
sarken
merged commit 08a676d
into
otwcode:master
Nov 30, 2017
sarken
added
Reviewed: Ready to Merge
and removed
Awaiting review
labels
Nov 30, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
elzj commentedNov 29, 2017
Issue
https://otwarchive.atlassian.net/browse/AO3-5221
Purpose
Ensures bookmarkable objects (works, series, external works) get indexed/updated/deleted in the bookmarks index when their data changes. Also adds a method to index a single document and code to identify the correct indexers for a class.
Testing
See issue.