retire icon indicating copy to clipboard operation
retire copied to clipboard

Storage defaults to string when property is a class

Open kelaban opened this issue 12 years ago • 3 comments

(using 0.6.0) When a property is set as an array of a class object the storage will default to use string. This will throw a parsing exception from elasticsearch when an object is being indexed. Explicitly setting :type => 'object' will fix the issue.

For example:

  property :myproperty, :class => [My::Class], :default => [], type: 'object'

will work. However omitting the type will fail later during indexing because elasticsearch expects an array of strings.

kelaban avatar Jun 18 '13 17:06 kelaban

@kelaban so this property should be an array of a custom type?

phoet avatar Jul 05 '13 11:07 phoet

Yes thats correct

kelaban avatar Jul 05 '13 15:07 kelaban

When digging around this issue, I have actually found much more profound problems with casted collections: they seem to be not indexed properly, etc. Will try to find some time to resolve these and add integration tests for the set of features.

karmi avatar Jul 21 '13 17:07 karmi