Pair Review Comments Not Viewable due to Elasticsearch Clause Count Error

Problem: An "All shards failed" error prevents viewing comments on the pairs page in the Tamr UI:

Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

The elasticsearch-procurify.log provides the following detailed error message:

[2020-06-30T13:45:16,313][DEBUG][o.e.a.s.TransportSearchAction] [localhost] All shards failed for phase: [query]

org.elasticsearch.index.query.QueryShardException: failed to create query: {

"bool" : {

"should" : [

{

"bool" : {

"must" : ...

...}

org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 4096

at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:114) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]

at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:127) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]

at org.elasticsearch.index.query.ExistsQueryBuilder.newObjectFieldExistsQuery(ExistsQueryBuilder.java:208) ~[elasticsearch-6.8.2.jar:6.8.2]

at org.elasticsearch.index.query.ExistsQueryBuilder.newFieldExistsQuery(ExistsQueryBuilder.java:195) ~[elasticsearch-6.8.2.jar:6.8.2]

Cause: The issue may occur when we have a high number of comments for a project in Tamr.

Resolution: To solve this issue, increase the TAMR_ES_MAX_CLAUSE_COUNT to 100,000 and restart Tamr and Tamr dependencies. If the issue still persists, increase to a higher value such as 200,000. It might also require an increase in the ES_HEAP_SIZE.