From 5a0ed39ffd4ab5166e9632e537c3cf1aef49bed3 Mon Sep 17 00:00:00 2001 From: Bryan Burkholder <771133+bryanlb@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:59:31 -0700 Subject: [PATCH] Make total fields limit configurable via sysprop (#997) Co-authored-by: Bryan Burkholder --- .../astra/logstore/opensearch/OpenSearchAdapter.java | 3 ++- docs/topics/System-properties-reference.md | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/astra/src/main/java/com/slack/astra/logstore/opensearch/OpenSearchAdapter.java b/astra/src/main/java/com/slack/astra/logstore/opensearch/OpenSearchAdapter.java index d597e6becc..10a3e2d4bb 100644 --- a/astra/src/main/java/com/slack/astra/logstore/opensearch/OpenSearchAdapter.java +++ b/astra/src/main/java/com/slack/astra/logstore/opensearch/OpenSearchAdapter.java @@ -129,7 +129,8 @@ public class OpenSearchAdapter { // we can make this configurable when SchemaAwareLogDocumentBuilderImpl enforces a limit // set this to a high number for now - private static final int TOTAL_FIELDS_LIMIT = 2500; + private static final int TOTAL_FIELDS_LIMIT = + Integer.parseInt(System.getProperty("astra.mapping.totalFieldsLimit", "2500")); // This will enable OpenSearch query parsing by default, rather than going down the // QueryString parsing path we have been using diff --git a/docs/topics/System-properties-reference.md b/docs/topics/System-properties-reference.md index acf40962f6..6e42446afb 100644 --- a/docs/topics/System-properties-reference.md +++ b/docs/topics/System-properties-reference.md @@ -73,4 +73,13 @@ schema. {style="narrow"} defaultValue -: 500 \ No newline at end of file +: 500 + + +## astra.mapping.totalFieldsLimit +experimental +Maximum amount of total fields used by the mapper service for query parsing. + +{style="narrow"} +defaultValue +: 2500