I am trying to query for FeedItems that belong to a specific community as follows:
FIND {searchTerm} RETURNING FeedItem(Id,Title,Body) WITH NETWORK IN ('SomeID')
However, I noticed that the query returns feedItems that also have a NetworkScope of 'AllNetworks' (feed item is available in all communities). however, when I specify in a SOQL
Select ID from FeedItem where Networkscope='SomeID'
the appropriate FeedItems are returned.
I have also tried using: WITH NETWORK = 'SomeID', but to no avail
The documentation in regards to querying WITH NETWORK NetworkIdSpec can be found here
Another important note, from the SOAP API Doc:
Note the following exceptions for NetworkScope:
- Only feed items with a Group or User parent can set a NetworkId or a null
value for NetworkScope.- For feed items with a record parent, users can set NetworkScope only to AllNetworks.
- You can’t filter a FeedItem on the NetworkScope field.
not sure what the documentation means by the last point:
You can’t filter a FeedItem on the NetworkScope field.
As in SOQL I seem to be able to filter by it.
Could someone explain why FeedItems with the AllNetworks Network scope are appearing in my SOSL and not in my SOQL?
What would be the best way to filter on FeedItems in my community using SOSL while excluding feeditems with networkscope = AllNetworks?