riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
618 stars 152 forks source link

Dynamic attributes and secondary indexes #304

Closed ghost closed 12 years ago

ghost commented 12 years ago

Is it possible to create secondary indexes on dynamically defined attributes?

For example, something like this?


CSV.table('data.csv', csv_options).each do |row|
  doc = Data.new
  row.to_hash.each do |k, v|
    doc[k] = v
  end

  doc.index :property, String
  doc.save
end
ghost commented 12 years ago

This doesn't seem to work. I had to declare a property on the document and declare it as an index.