forked from karmi/retire
-
Notifications
You must be signed in to change notification settings - Fork 0
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
update #1
Merged
Merged
update #1
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
… task Previously, all records had to be loaded into memory (errr), better to use the `Model.count` method Closes #471
… call is not destructive Closes #460.
…ce as lambdas Now, it's possible to do: class MyModel include Tire::Model::Persistence property :created_at, :default => lambda { Time.now } end Note though, that the lambda is evaluated when you create the object, not when you access the property. Closes #459
Use "tmp" or "scratch" folders for things you wanna keep along the project, but not version them.
Previously, the `filter` facet type in Tire's DSL had the `terms` filter hardcoded. With this patch, it's possible to use [any DSL method](https://github.com/karmi/tire/blob/master/lib/tire/search/facet.rb) for the facet declaration. See <http://www.elasticsearch.org/guide/reference/api/search/facets/filter-facet.html> for documentation. Closes #425.
…ctiveSupport ActiveSupport, in many cases, calls `to_json` methods with arguments. This patch adds optional argument to all `to_json` methods to guard against that.
Allows finders and other users of retrieve to set wrappers safely without race conditions due to the use of a global wrapper variable.
Using the :wrapper option avoids thread-safety issues with the global wrapper config variable. In a threaded environment this would manifest with searches occasionally being wrapped with the wrong model class. Closes #453
Example Query: ``` ruby Tire.search(@@index_name) do query do boolean do should do term :level, { value: "high", boost: 3} end end end end ``` More information about this can be found in #422 where there is more example code. The resulting JSON output of the above is: ``` json { "query": { "bool": { "should": [{ "term": { "level": { "value": "high", "boost": 3 } } }] } } }� ``` This does not break any other behaviour. Closes #422, closes #423.
…odel::Persistence::Finders Fixes #453.
…ted in elasticsearch Previously, when the index could not be created due to eg. error in mapping, it was silently ignored and data were still indexed (with dynamic mapping). This was a source of hard-to-pin-down errors. When there's an error while creating the index, the Rake task will exit(1) and print the HTTP response, now. Closes #392
…ated on class load Note, though, that for most production settings, it does _not_ make sense to rely on automatic index creation. Create your indices properly, in advance, in a controlled manner. Closes #293
…r the Rails example application
* Added `first_page?` and `last_page?` methods for <https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/helpers/action_view_extension.rb> * Added test coverage
…tion are indexed Previously, objects other then `String` or `Proc` were silently discarded when evaluating the `:as` mapping option. With this change, you may pass whatever object you like in the `:as` mapping option: class MyModel include Some::ORM include Tire::Model::Search mapping do indexes :field, :type => 'string', :analyzer => 'keyword', :as => SomeOtherObject.whatever end end end class MyModel include Some::ORM include Tire::Model::Search mapping do indexes :field, :type => 'string', :analyzer => 'keyword', :as => [1, 2, 3] end end end This commit is a conceptual opposite of 0ccee42. Until #446 is decided, this change brings some consistency to the behaviour.
* Restructure the code * Use `params` Hash to encode URL parameters for elasticsearch * Prepare solving #256 in a more robust way
This patch builds upon work in nickhoffman/tire@978d632 by @nickhoffman, and the refactoring in 01828d3. It allows to pass a `parent` parameter to Index#store. See "Parents & Children" in <http://www.elasticsearch.org/guide/reference/api/index_.html> Note, that adding support for other URL parameters, such as routing, timestamp, TTL, etc. is just a matter of adding proper key in the `params` hash and adding tests. Closes #256.
…t tests * Use `assert_equal`, not `==` for better failure output * Split multiple tests for the Index#analyze method into separate ones
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
uodate origin