how do i enable nested fields via ruby sdk like ty...
# community-help
w
how do i enable nested fields via ruby sdk like typesense-rails?
i tried to do this with typesense rails:
Copy code
typesense auto_remove: false, index_name: Emp, per_page: 20, enabled_nested_fields:true do 
  [DEFINE attributes]
end
and got this error
Copy code
[5] pry(main)> Claims::Policy.reindex!
Typesense::Error::RequestMalformed: Type `object` or `object[]` can be used only when nested fields are enabled by setting` enable_nested_fields` to true.
j
Looks like we don't support that in typesense-rails
I would recommend using the ruby SDK (which is actively maintained) to create collection
w
oooh
how do we do that with ruby sdk then
because we are using rails, and our index linked to t he model right now
j
Where it has "default_sorting_field", you can add enable_nested_field at the same level
w
so the team has no plans to make typesense-rails support this option?
j
Not in the near term. We might do a full rewrite of the rails integration sometime next year
w
ok
so this setting has to be enabled at the time we create an collection right
j
That's correct
w
and if i have an existing collection, it means i have to recreate the collection and reindex?
j
Unfortunately yes
w
icic
just 1 more question, i understand that typesense-rails gem has a dependency on the ruby typesense client. if there are any updates to typesense client like deprecating functions that typesense rails might be using, will you at least update typsense-rails to support the replacement functions at the very least?
j
We've never had to fully deprecate a method in any of our SDKs, so this should be very rare. But in case we do have to do it, and we don't yet have another rewrite of the rails gem, then yes we'll update the current one to make it doesn't get affected by the deprecation
w
thanks Jason for the reassurance!
👍 1