Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 1, 2012
  1. @vhyza

    [PERSISTENCE][FIX] Changing instance properties should not affect pro…

    vhyza authored
    …perty default
    
    Hash and Array... were passed to property as reference, not object
  2. @pshoukry

    [FACETS] Added "term_stats" facets [#252]

    pshoukry authored committed
    * adding terms_stats facets support
    * removing unnecessary tests from statistical
    
    See http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet.html
  3. @pshoukry
  4. @ralph

    [FIX] FilteredQuery: chain multiple filters with `and` by default

    ralph authored committed
    Closes #254, closes #255.
Commits on Feb 28, 2012
  1. [FIX] Added encoding header for DSL example file

    authored
    (Reported as #257)
Commits on Feb 14, 2012
  1. Improved code structure, added unit test and separated integration te…

    authored
    …sts for the "text" query implementation
    
    Closes #168.
  2. @woodhull

    Added "text" query as part of the DSL [#168]

    woodhull authored committed
    Example:
    
        Tire.search('articles-test') do
          query { text :title, '+1' }
        end
    
    See <http://www.elasticsearch.org/guide/reference/query-dsl/text-query.html>
  3. @nz

    Prefer ELASTICSEARCH_URL environment variable as a default URL, if pr…

    nz authored committed
    …esent
    
    Note: Main reason is frictionless deployment at <Heroku.com>
    
    Closes #240, closes #241
Commits on Feb 4, 2012
  1. [GEMS] Updated Turn dependency and relaxed ActiveRecord dependency ve…

    authored
    …rsion
    
    NOTE: Supermodel depends on ancient version ofActiveModel: 3.0. Replace with another "generic activemodel" or sort it out somehow.
  2. @namxam

    [DOC] Fixed global facet example in documentation

    namxam authored committed
    Closes #227.
Commits on Jan 11, 2012
  1. [REVERT][FIX] Fix the URL-incompatible translation of namespaced mode…

    authored
    …ls into `document_type`
    
    Revert "[ACTIVEMODEL][FIX] Fix the incorrect translation of namespaced models into `document_type`".
    
    The "proper" translation translates `MyNamespace::MyModel` to `my_namespace/my_model`, which
    allows proper loading of namespaced models, but fucks up the encoded URL, because of something like:
    http://.../indexname/my_namespace/my_model/_search?...
    
    This reverts commit 89bc663.
    
    See #189.
Commits on Jan 7, 2012
  1. [TEST] Fixed test failure because of "/" in `document_type` of namesp…

    authored
    …aced model
    
    TODO: This is related to patch in #189, and actually means namespaced models cannot be used with Tire.
  2. @greglearns

    [REFACTOR] Changed that the Search::Search#perform method is lazy loa…

    greglearns authored committed
    …ded (allows chainability)
    
    DSL#search and Search::Search lazy load data and are chainable, until #results or #response called.
    
    This allows something like this:
    
        s = Tire.search('articles') { query { string 'title:T*' } }
        s.filter :terms, :tags => ['ruby']
        p s.results
  3. @ddnexus

    [ACTIVEMODEL][FIX] Fix the incorrect translation of namespaced models…

    ddnexus authored committed
    … into `document_type`
    
    When loading the namespaced models from ES, the exception: "NameError: uninitialized constant" was raised.
    
    This is due to the fact that ActiveModel does, for reasons unknown, funky shit here: <https://github.com/rails/rails/blob/v3.1.3/activemodel/lib/active_model/naming.rb#L50-52>
    
    Closes #189.
  4. @chromeragnarok

    [ACTIVEMODEL] Added injection of the `paginate` method when missing (…

    chromeragnarok authored committed
    …Kaminari)
    
    The `paginate` method, needed for the import task, is injected in the class being imported
    when the class implements Kaminari pagination, so the import Rake task works out of the box.
    
    Closes #191. Also see: #48, #108.
  5. @haihappen

    [ACTIVEMODEL] Added the `:as` option for model mapping to dynamically…

    haihappen authored committed
    … set property value in serialization
    
    Example:
    
        class Article
          belongs_to :author
    
          mapping do
            indexes :author, as: proc { author.name }
            indexes :author_email, as: 'author.email'
          end
        end
    
    Ccloses #184, closes #186.
Commits on Jan 6, 2012
  1. @dylanahsmith

    [FIX] Fixed incorrect curl format in logger for Index#open

    dylanahsmith authored committed
    Closes #195.
  2. @dylanahsmith

    [FIX] Index#retrieve returns nil when the document doesn't exist

    dylanahsmith authored committed
    Previously an exception was raised on document.update(h['fields'])
    since h['field'] returned nil:
    
        index = Tire::Index.new("empty")
        index.create
        puts index.retrieve("doc", 'NOTEXIST').inspect
    
    Closes #193.
Commits on Dec 23, 2011
  1. @dylanahsmith

    [HTTP][FIX] Re-raise the RestClient::RequestTimeout and RestClient::S…

    dylanahsmith authored committed
    …erverBrokeConnection exceptions
    
    These exceptions should be re-raised so the user can catch it and possibly try the search at another node, etc.
    
    Closes #170, closes #171
Commits on Dec 18, 2011
  1. @itayco

    [FIX] Fixed an error where facets did not respect the "blocks with ar…

    itayco authored committed
    …guments" DSL variant
    
    Closes #176.
Commits on Dec 12, 2011
  1. @vhyza
  2. @vhyza
Commits on Dec 10, 2011
  1. @dylanahsmith

    [FIX] Use currently set `Configuration.url` in `Search::Search#perfor…

    dylanahsmith authored committed
    …m` and don't freeze it in initializer
    
    Makes it easier to re-perform a failed search on another server, eg.:
    
        search = Tire::Search::Search.new('articles')
        # build search ...
        servers = ["http://localhost:9200", "http://localhost:9201"]
        begin
          Tire::Configuration.url servers[0]
          search.perform
        rescue Errno::ECONNREFUSED => e
          Tire::Configuration.url servers[1]
          search.perform
        end
        # do something with results ...
    
    Closes #163.
Commits on Dec 1, 2011
  1. @vhyza
Commits on Nov 30, 2011
  1. @vhyza

    [PERSISTENCE] Changed that search in persistence returns instances of…

    authored vhyza committed
    … model not Item
  2. @vhyza
Commits on Nov 29, 2011
  1. [DOC] README updates

    authored
  2. [ACTIVEMODEL] Added the support for casting model properties as Ruby …

    authored
    …objects
    
    In Tire::Persistence, you define a model property to be casted
    as a custom Ruby class instance.
    
    Currently, the implementation expects your class to take a Hash of attributes
    on initialization. (There are plans to support custom initialization logic.)
    
    You can cast either single values (see `Author` in the example below),
    or collections of values (see `[Comment]`). The behaviour was inspired
    by the CouchRest-Model gem.
    
    Also, all strings which conform to the UTC time format are automatically
    converted to Time objects.
    
    Also, all Hashes are automatically converted to Hashr [https://rubygems.org/gems/hashr]
    instances, allowing easy "dot-style" access to nested hash properties.
    
    Example:
    
        class Article
          include Tire::Model::Persistence
    
          validates_presence_of :title, :author
    
          property :title,        :analyzer => 'snowball'
          property :published_on, :type => 'date'
          property :tags,         :default => [], :analyzer => 'keyword'
          property :author,       :class => Author
          property :comments,     :class => [Comment]
        end
    
    See the test suite for more information.
  3. [GEMS] Added Hashr (https://rubygems.org/gems/hashr) as dependency

    authored
    Hashr allows to easily wrap Hashes in object-like manner:
    
        config = Hashr.new('foo' => { 'bar' => 'bar' })
    
        config.foo?     # => true
        config.foo      # => { :bar => 'bar' }
    
        config.foo.bar? # => true
        config.foo.bar  # => 'bar'
    
    See <https://github.com/svenfuchs/hashr> for more info.
  4. [REFACTORING] Extracted updating item/model instance attributes to de…

    authored
    …dicated method (`__update_attributes`)
  5. [ACTIVEMODEL] Added support for property defaults in Tire::Model::Per…

    authored
    …sistence
    
    In the new implementation of the `property` method, you can define default values for your model attributes:
    
        class Article
          include Tire::Model::Persistence
    
          property :title
          property :tags, :default => []
        end
    
        Article.create title: 'Test'
    
        Article.all.first.title
        # => 'Test'
    
        Article.all.first.tags
        # => []
Something went wrong with that request. Please try again.