Customers that have a large number of objects might see the following error in search-server.log in <APPIAN_HOME>/logs/search-server/.
<APPIAN_HOME>/logs/search-server/
[YYYY-MM-DDTHH:MM:SS.sssZ][DEBUG][org.elasticsearch.action.search.TransportSearchAction] [%node_name] All shards failed for phase: [query] org.elasticsearch.index.query.QueryShardException: failed to create query: The number of terms [xxxxxxx] used in the Terms Query request has exceeded the allowed maximum of [65536]. This maximum can be set by changing the [index.max_terms_count] index level setting. at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:369) ~[elasticsearch-7.9.1.jar:7.9.1]...Caused by: java.lang.IllegalArgumentException: The number of terms [xxxxxxx] used in the Terms Query request has exceeded the allowed maximum of [65536]. This maximum can be set by changing the [index.max_terms_count] index level setting.
During an attempt to open an application, the following system error is displayed on the front end:
Associated symptoms include but are not limited to:
The number of terms used in a term query has exceeded the allowed maximum of designer-objects-ia index in the Search Server, which is defined by index.max_terms_count. By default, the value of index.max_terms_count is 65536. See the Elasticsearch documentation for more information.
index.max_terms_count
In Appian, the number of dependents/precedents that an object has equated to the number of terms. This does not necessarily mean that the customer has an object that has over 65536 dependents/precedents. The likelihood of reaching the term limit increases as the number of design objects and their dependencies grows.
Follow the steps below to update the index.max_terms_count setting for the designer objects index. This operation will not cause downtime nor require Appian components to be restarted.
Note: For HA sites, the steps only need to be run on one of the nodes as the setting will be automatically applied to the other nodes. This setting will not be overridden on Search Server or App Server restarts.
<APPIAN_HOME>
APIKEY=$(awk '/^conf.data.search-server.restclient.apiKey=/ { match($0, /conf.data.search-server.restclient.apiKey=(.*)/, arr); print arr[1] }' <APPIAN_HOME>/conf/custom.properties); AUTHHEADER="Authorization: ApiKey $(echo -n $APIKEY | base64 -w0)"; alias curl='curl --header "$AUTHHEADER"'
curl 'localhost:9200/designer-objects-ia/_settings?pretty'| grep max_terms_count
[xxxxxxx]
curl -X PUT localhost:9200/designer-objects-ia/_settings?pretty -H 'Content-Type: application/json' -d'{ "index" : { "max_terms_count" : "100000" }}'
{"acknowledged" : true}
This article applies to all versions of Appian.
Last Reviewed: November 2023