Add an adaptor to es_objects and template function to reduce code #1429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following pull request is an attempt to reduce the amount of code in the es_objects plugin and make it easier to add new objects. It uses an adaptor approach very similar to the one used in elasticsearch plugin for account history, this time for objects.
I think more can be done, specifically there is duplicated code in
index_database
function that i tried to reduce however i was not able to make it due to casting, types, etc.I opted on submitting this changes as i think they go in the right direction, as i don't know exactly when i will have the time to work on this again i preferred to submit what i have now and don't let the code lost.
This is a refactor, users can continue using this plugin the same way they were doing before without changes in the options however i am considering it will be better to add the objects the user want to save in a vector instead of individual options for each as it is now.
In initial testings i was able to sync without any error up to 2016-05-10T02:10:30 with everything turned on(all objects) with command: