We have implementing custom fields feature one of our application.
Currently we store table name 'abc' data inside sunspot solr.
Now we have added one table custom fields which is has many relation with 'abc' table.
We store custom field data with multiple data types. like date, string, boolean etc.
Write now we are string dynamic field data using dynamic_string type.
below is the ruby code example.
searchble do dynamic_string :custom_field, stored: true do custom_fields.inject({}) do |hash, custom_field| hash.merge((custom_field.key) => custom_field.value) end end end
But we want to define dynamic datatype based on type of custom field.
like if string type data it wil be dynamic string, date data type it will we dynamic_date etc