Hello @Lyn
I would not change searchFlags simply as part of running adprep /forestprep. adprep extends the schema required by the newer Windows Server version; it doesn't normally require you to recreate indexes for existing custom attributes.
The first step should be to compare the affected attribute definitions before and after the schema update and confirm whether their searchFlags, syntax, isSingleValued, and related properties actually changed.
For example:
Get-ADObject -SearchBase (Get-ADRootDSE).schemaNamingContext `
-LDAPFilter "(lDAPDisplayName=<attributeName>)" `
-Properties lDAPDisplayName,searchFlags,attributeSyntax,isSingleValued
searchFlags is a bit field. For example, bit 1 (0x1) causes an attribute to be indexed, while other bits enable capabilities such as containerized indexing, Ambiguous Name Resolution, confidential attributes, and tuple indexing. These shouldn't be enabled without understanding the LDAP queries and the impact across your DCs.
If the custom attribute is already indexed and its definition hasn't changed, I wouldn't assume rebuilding the index will fix the application. Instead, capture the actual LDAP query and compare its behavior before/after the upgrade. Slow or incomplete results can also be caused by query construction, paging, referrals, time limits, or application assumptions rather than the schema extension itself.
Also remember that schema changes are forest-wide and effectively irreversible, so don't experiment with searchFlags directly in production. Reproduce the schema upgrade in a representative test environment and validate the legacy application's LDAP queries there first.
If you can provide the affected attributes' current searchFlags values and a sanitized example of one failing LDAP query, we can determine whether indexing is actually involved before making any schema changes.
Please "Accept the Answer" if this information helped you. This will help us and others in the community as well.