soql – How to change the filterable property in a schema
You cannot change this (aside from maybe changing the field type on custom fields, which may be enough to toggle between filterable and unfilterable).
If a given field doesn’t have the “filterable” property, then you simply cannot use it in the WHERE clause of a SOQL query.
In the case of “long text area” fields, you could instead use SOSL (e.g. FIND 'John Doe' IN ALL FIELDS RETURNING Contact) but you still can’t filter on such fields.
In general, whatever operations (filtering, grouping, aggregating, etc…) can’t be done with a query are things that you would need to write Apex to achieve.
Read more here: Source link
