Relation fields/widget in Plone 5

I am trying to implement a relation field that restricts on object_provides like below

foobar= RelationList(
    title=_(u'Foo bar'),
                                  object_provides=''), )

This "works", except searching in the field does not have any effect. Perhaps I should not use CatalogSource but instead create a named vocabulary? I tried to find documentation on this but appears to be out of date. All of the functionality it is talking about looks to be more of a 4.3 thing, with plone.formwidget.contenttree/autocomplete instead of the new select2 stuff.

It would also be nice to know how to use the AjaxSelectFieldWidget with relations as well.

Plone 5.0.5

Look at Maybe that helps.

This is mostly an error on my part. What I had above is indeed correct and that in itself will result in something searchable. But I have a collective.elasticsearch configuration and that removes the superfluous ZCTextIndexes. Obviously the machinery isn't set up to interact with elasticsearch here, it's just trying to do a catalog search on a nonexistent index. I misinterpreted that as being a problem with CatalogSource.

I do think the documentation I linked above could stand to be updated. Philip's link seems to confirm my belief that it is antiquated in favor of using tools and widgets.

On the off change anyone is interested, the reason it didn't support searching is because it generates a search query that looks like this

{'object_provides': '', 'sort_on': u'sortable_title', 'sort_order': 'ascending', u'SearchableText': {'query': u'framework*'}}

collective.elasticsearch seems to support a value for SearchableText being a str/unicode, but not a dict. I will either patch that or subclass CatalogSource.