Improvements to Search field helper for searchable fields
Currently SeachableField helper accepts a type. However, this is not necessary, since only edm.String and edm.Collection(edm.String) may be searchable. Instead, SeachableField should accept a boolean flag for whether it is a collection or not:
SearchableField(name="foo) # type = String
SeachanbleField(name="bar, collection=True) # type = Collection(String)
cc @xiangyan99 @heaths
Thinking more, perhaps SimpleField should similarly get a collection=true boolean? UX study participants also seemed to have a hard time composing edm.Collection with other types (they were surprised it was a function, for one).
We could do that. The ODataType.Collection also acts like a function in other languages, but while we could still allow that, the parallel to have collection=True is nice. @brjohnstmsft and @bleroy, thoughts?
Our type system is relatively simple today, but what if in the future we add something weird like unions? The nice thing about modeling type composition with functions is that it's trivially extensible without breaking backwards compatibility. Boolean flags, not so much.
We had previously decided on collection=true in other languages, since ComplexField can only be complex or collection(complex), and searchable can only be string or collection(string). Are you suggesting we not use the collection property there, or just in this case (for consistency)?
Just in the case of SimpleField
Fair enough. Let's leave the ODataType.Collection() function-like construct we have in other languages currently.
Fixed in #11683