Groovy Support to Count the Number of Search Fields Enabled for Adaptive Search

Adaptive Search displays the list of records matching the saved search criteria and provides you with a record count. You can use Groovy scripts to count the total number of search fields you have enabled in Adaptive Search.

Sometimes, the amount of attributes enabled for a business object may exceed the recommended amount of 500 for each object, so you may not find the field attribute you were searching for. You can reduce the count of fields by deselecting the Include in Object Reference check box for child entities that you may not require. For more details, see the topic Make a Field Searchable in the UI.

Number of Search Attributes Enabled

Here's sample of the query trigger code that will display a count for the total number of search attributes you have enabled in your Adaptive Search test environment.

Note: If you want to count the enabled search attributes in your active production environment, edit the script and replace Sandbox with Active.
SELECT
ea.ATTRIBUTE_UUID,
ltrim(sys_connect_by_path(CASE WHEN (ea.max_occurs is null and
ea.ATTRIBUTE_TYPE_NAME < > `Enum ) THEN ea.ATTRIBUTE_NAME||'[]' ELSE
ea.ATTRIBUTE_NAME END,`. ),`. ) AS DOC_ATTRIBUTE_PATH,
ad.AGGREGATION_UUID,
ad.SEARCHABLE_FLAG
FROM FUSION.ZCA_ES_ATTRIBUTES ea, FUSION.ZCA_ES_ATTRIBUTE_DEFAULTS ad
WHERE ( (level > 1
AND ea.INCLUDE_IN_REFERENCE_FLAG = `Y  )
OR ( level = 1)
OR (ea.RECORD_ENTITY_UUID IS NOT NULL
AND (SELECT COUNT(*)
     FROM FUSION.ZCA_ES_ATTRIBUTES iea
     WHERE iea.ENTITY_UUID = ea.RECORD_ENTITY_UUID
     AND iea.INCLUDE_IN_REFERENCE_FLAG = `Y ) > 0 ) )
AND ea.META_MODEL_VERSION_UUID = (select meta_model_version_uuid from
FUSION.zca_es_meta_model_versions where workflow_state_type_name = `Sandbox )
AND ea.INDEXED_FLAG=`Y 
AND ea.ENABLED_FLAG=`Y 
AND ea.SEARCHABLE_FLAG = `Y 
AND ea.ATTRIBUTE_UUID = ad.ATTRIBUTE_UUID
AND ad.SEARCHABLE_FLAG = `Y 
START WITH ea.ENTITY_UUID = `d8c3af80-bc97-4ff6-a37c-cf9e8e1775c9  AND
ea.META_MODEL_VERSION_UUID = (select meta_model_version_uuid from
FUSION.zca_es_meta_model_versions where workflow_state_type_name = `Sandbox )
CONNECT BY (ea.ENTITY_UUID = PRIOR ea.RECORD_ENTITY_UUID AND
ea.META_MODEL_VERSION_UUID = (select meta_model_version_uuid from
FUSION.zca_es_meta_model_versions where workflow_state_type_name =
`Sandbox ))
AND PRIOR ea.ENABLED_FLAG=`Y  AND PRIOR ad.SEARCHABLE_FLAG = `Y  AND ((PRIOR
ea.ATTRIBUTE_TYPE_NAME!=`ForeignKey ) OR (PRIOR
ea.ATTRIBUTE_TYPE_NAME=`ForeignKey  AND ea.INCLUDE_IN_REFERENCE_FLAG=`Y ));

For more information on Groovy scripting, see the related links.