Create multiple fields at once on CloudSearch using PHP SDK

0

I have to create multiple fields at once on CloudSearch using PHP SDK. This is because domains are generated dynamically through code as well based on tenants name (system is using tenancy). After creating the domain index fields needs to be created next I have below code to loop through the array of fields with field name/type.

        $fields[] = ['name' => 'last_note', 'type' => 'text'];
        $fields[] = ['name' => 'tasks', 'type' => 'text'];
        $fields[] = ['name' => 'loan_approved_applicant', 'type' => 'text'];

        foreach ($fields as $field) {
            $this->awsCloudSearchClient->defineIndexField([
                'DomainName' => $domain,
                'IndexField' => [
                    'IndexFieldName' => $field['name'],
                    'IndexFieldType' => $field['type'],
                ]
            ]);
            sleep(10);
        }

This actually works if I have only fields. On production considering our production data and fields, I'm getting rate exceeded error If I create those field inside a loop.

profile picture
JuneDC
已提問 1 個月前檢視次數 155 次
1 個回答
0

Hello,

Can you increase delay and see if it helps? Further, I would suggest you to reach out through AWS Technical Support with your CloudSearch details and we can further investigate the rate exceeded issue error. You can reach out through following link-

https://console.aws.amazon.com/support/home#/case/create

AWS
支援工程師
Aman_A
已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南