Title: SOSL for External Object
Tags: sosl;lightning-connect;salesforce-connect;externalobjects
Question: I have configured a Salesforce Connect relationship to an external data source using a custom Apex adapter. I am trying to configure one of the external objects to allow search.
I have selected the "Allow Search" checkbox on the external object and have created a tab for the external object. The profile I'm using has read access for the object.
Firstly, the external object is not appearing in the available objects for results.
Secondly, when I run a SOSL query against the external object in the developer console, I receive the error entity type <External Object&gt; does not support search. Do I need to do anything beyond checking "Allow Search" on the external object?
Additionally, when I navigate to the external data source and select "Validate and Sync", the "Allow Search" setting stays checked. When I then click "Sync", the external object has the "Allow Search" setting unchecked. I am not seeing anythng in the documentation for DataSource.Table or DataSource.Column that allows for explicitly specifying that an external object should allow search. In my DataSource.Connection class, I have a search method defined.
For reference:
DataSource.Table documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_DataSource_Table.htm
DataSource.Column documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_DataSource_Column.htm#apex_class_DataSource_Column

Here is the accepted answer: I found my error and resolved it.
I was missing the appropriate "Capability Enum" (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_enum_DataSource_Capability.htm) value in the getCapabilities() method in my DataSource.Provider.
So I went from
override global List<DataSource.Capability&gt; getCapabilities() {
List<DataSource.Capability&gt; capabilities = new List<DataSource.Capability&gt;();
capabilities.add(DataSource.Capability.ROW_QUERY);
capabilities.add(DataSource.Capability.REQUIRE_ENDPOINT);
return capabilities;
override global List<DataSource.Capability&gt; getCapabilities() {
List<DataSource.Capability&gt; capabilities = new List<DataSource.Capability&gt;();
capabilities.add(DataSource.Capability.ROW_QUERY);
capabilities.add(DataSource.Capability.SEARCH);
capabilities.add(DataSource.Capability.REQUIRE_ENDPOINT);
return capabilities;
To round out what I learned here, the "Validate and Sync" button runs the Apex from the DataSource.Connection sync() method, while clicking the "Sync" button subsequently runs at least the Apex in the DataSource.Provider getCapabilities() method.

Here is another answer: Did You enable it to external Data Source as well?
To include an external object in SOSL and Salesforce searches, enable
search on both the external object and the external data source.
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_limits_external_objects.htm
Comment for this answer: Right now, since I'm using a custom Apex adapter, I'm simply doing a custom callout within the `search` method and parsing the response, so yes it should be supported. Of course unless something else is needed here that I'm not aware of.
Comment for this answer: To be clear as well, the `search` method is implemented similarly to this Salesforce documentation: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_DataSource_Connection.htm

{'source': 'StackExchangeDataset', 'subset': 'salesforce.stackexchange.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2018:00:03/27/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<sosl><lightning-connect><salesforce-connect><externalobjects>', 'Title': 'SOSL for External Object', 'ViewCount': 535, 'id': 213002, 'user_AboutMe': '<p>C++, Python developer in Seattle, WA.</p>\n', 'user_AccountId': 7191255.0, 'user_DisplayName': 'baronsbaby', 'user_Reputation': 454.0, 'user_Views': 14.0, 'user_id': 44105.0}}