This repository was archived by the owner on Jul 16, 2024. It is now read-only.
forked from karmi/retire
-
Notifications
You must be signed in to change notification settings - Fork 0
Rebase to lastest upstream #1
Open
me
wants to merge
71
commits into
master
Choose a base branch
from
ip_rebase
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`bundle exec rake environment tire:import:all` now succeeds for a `Address` model. Fix provided by @congshuanglong. Closes karmi#733, closes karmi#744
Usage: Tire.search 'venues' do query { string 'pizzeria' } facet 'geo' do geo_distance :location, {:lat => 53.54507, :lon => 9.95309}, [{:to => 1}, {:from => 1, :to => 10}, {:from => 50}], unit: 'km' end end Closes karmi#701
…tured the source code Allow the DSL version of filters definition: s = Tire.search('articles-test') do query do custom_filters_score do query { all } # Give documents over 300 words a score of 3 filter do filter :range, words: { gt: 300 } boost 3 end end end end Related: karmi#734
Sometimes, when you have a complicated ActiveRecord relationships, you need tight control on the importing SQL queries and mechanics. This patch allows you to implement your own custom strategy, by implementing an `import` method, and passing it to <Model.import> as the `:strategy` option. Example: class MyCustomImportStrategy include Base def import &block klass. where(published: true). joins(:comments). find_in_batches(:batch_size => options[:per_page]) do |batch| index.import batch, options, &block end self end end Closes karmi#709
Example: s = Tire.search 'articles-test', wrapper: ::MyCustomWrapper do query { match :title, 'one' } end s = Tire.search( 'articles-test', payload: { query: { match: { title: 'one' } } }, wrapper: ::MyCustomWrapper ) Closes karmi#716
Previously, `to_hash` method was checked, but not called on the params object
Iterating through mongoid collections using skip() can get really slow for large collections, as it has to traverse from the beginning of the collection (http://docs.mongodb.org/manual/reference/method/cursor.skip/). We were seeing our import task freeze up with high I/O after importing around 2.5 million records in a 6 million record collection. This commit alters the Mongoid import task so that it batches manually and makes the use of Mongoid's cursor to only return a small batch of results. Closes karmi#724
…lection In Mongoid import strategy, use the modulo division for better semantics of breaking up the collection into batches. Fixes: karmi#724
As reported by some users, the auto-loading didn't invoked/executed the task properly, resulting in errors eg. due to not loaded initializers. The auto-invoking has been removed, since the documentation clearly states to invoke the task before the importing one. Closes karmi#708
Previously, when asking for `_source` in `fields`, only the specific `fields` have been returned, not the full _source. The Elasticsearch behaviour has possibly changed here, see <karmi#31 (comment)> Closes karmi#663, closes karmi#687, closes karmi#712
…_elasticsearch_index Added a `__host_unreachable_exceptions` for each HTTP client (adapter), so we can rescue connection related errors in `create_elasticsearch_index`. Closes karmi#729
* Type is an optional argument * IDs argument is converted to Array Closes karmi#751
…ers compatibility Closes karmi#700
Filters are automatically wrapped by `:and` Closes karmi#715
When loading environment berfor tire:import:all, it is possible that models are already loaded when tire tries to load them. This can cause redefinition of constants and all other kind of havoc. This fix first tries to constantize the models to see if they are already loaded before trying to require them. See issue karmi#744 for discussion. Closes karmi#869
…when being casted, not on class load Closes karmi#864
Kaminari's method is called "out_of_range?", but tire uses "out_of_bounds?". I added the alias to make integration with Kaminari easier. Closes karmi#855
# update mapping index = Tire::Index.new(Contact.tire.index_name) puts index.mapping( Contact.tire.document_type, properties: { updated_at: { type: 'date', format: 'date_time_no_millis' } } ) # add data Contact.find_in_batches do |batch| documents = batch.map do |contact| { id: contact.id, type: Contact.tire.document_type, _routing: contact.account_id, doc: ContactSearchSerializer.new(contact, only: :updated_at).as_json } end puts index.bulk_update(documents) end Closes karmi#853
…e `response` method on return value Similarly to what is available in the persistent storage class. Closes karmi#908
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Because search needs the suggest functionality, that's not available in the version we are currently using.
Rubberband tests pass, not sure how to run Tire's own tests though.