Search Builder fields are truncated to 251 characters upon edit
If a Search Builder field exceeds 251 characters and the search is saved as a Smart Group, the search is stored in table civicrm_saved_search as expected, and the Smart Group is populated as expected.
However, if one attempts to edit the group's search parameters, then the Search Builder form populates with the search terms truncated at a length of 251 characters, with "..." appended. Subsequent execution of the search is be performed with the truncated search term, and saving the search as a new/updated group results in the truncated value being saved.
Create a smart group with a long search term
- Click on Search-> Search Builder.
- Create a search term with an expression exceeding 251 characters, e.g.: Contacts | Email | Primary | Regex | <LONG_EXPRESSION>
- Click Search.
- Click All XX records.
- Select from the Actions drop-down Group - create smart group.
- Name the group and save.
Attempt to edit the search criteria
- Click Contacts | Manage Groups
- For the newly created group, click Settings | Edit smart group criteria
<LONG_EXPRESSION> is truncated to 251 characters, plus "...".
<LONG_EXPRESSION> would not be altered. Form fields would fully support copy/pasted values of much greater length (e.g. 64K or more).
I found this limitation while searching for a pipe-delimited list of email domains, something that does not seem like an unreasonable thing to do.
Issue was confirmed on demo site