Skip to content

Commit

Permalink
resolve code review comments
Browse files Browse the repository at this point in the history
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
  • Loading branch information
yuye-aws committed Apr 30, 2024
1 parent f3a81f6 commit bae4e66
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;
import java.util.Objects;

import org.apache.commons.lang3.math.NumberUtils;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.env.Environment;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -152,8 +151,7 @@ private int getMaxTokenCount(final Map<String, Object> sourceAndMetadataMap) {
return defaultMaxTokenCount;
}
// if the index is specified in the metadata, read maxTokenCount from the index setting
String maxTokenCountString = indexMetadata.getSettings().get("index.analyze.max_token_count");
return NumberUtils.toInt(maxTokenCountString, defaultMaxTokenCount);
return IndexSettings.MAX_TOKEN_COUNT_SETTING.get(indexMetadata.getSettings());
}

/**
Expand Down

0 comments on commit bae4e66

Please sign in to comment.