Sha256: de7d01b936882fe1ea15249db34baf38d77580b285436f0854bc475e25d2cd67

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

class Meta
  include Virtus.model

  attribute :rating
  attribute :have
  attribute :want
  attribute :formats
end

class Album
  include Elasticsearch::Persistence::Model

  index_name [Rails.application.engine_name, Rails.env].join('-')


  mapping _parent: { type: 'artist' } do
  end

  attribute :artist
  attribute :artist_id, String, mapping: { index: 'not_analyzed' }
  attribute :label, Hash, mapping: { type: 'object' }

  attribute :title
  attribute :released, Date
  attribute :notes
  attribute :uri

  attribute :tracklist, Array, mapping: { type: 'object' }

  attribute :styles
  attribute :meta, Meta, mapping: { type: 'object' }

  attribute :suggest, Hashie::Mash, mapping: {
    type: 'object',
    properties: {
      title: {
        type: 'object',
        properties: {
          input:   { type: 'completion' },
          output:  { type: 'keyword', index: false },
          payload: { type: 'object', enabled: false }
        }
      },
      track: {
        type: 'object',
        properties: {
          input:   { type: 'completion' },
          output:  { type: 'keyword', index: false },
          payload: { type: 'object', enabled: false }
        }
      }
    }
  }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
elasticsearch-persistence-6.0.0.pre examples/music/album.rb
elasticsearch-persistence-5.1.0 examples/music/album.rb
elasticsearch-persistence-5.0.2 examples/music/album.rb
elasticsearch-persistence-5.0.1 examples/music/album.rb
elasticsearch-persistence-5.0.0 examples/music/album.rb