Skip to content

Commit d87bb6e

Browse files
committed
docs: round out v5-prep doc fixes
- guides/routing.md: add COORDINATOR and NULL rows to the policy override env-var table so it matches the 10 policy types in policy_override_env.go (USER_GUIDE.md already says "10 variables"). - guides/search.md: replace three Transport: &opensearchtransport.Client{Router: ...} blocks with Router: ... directly on opensearch.Config. The old form did not compile -- opensearch.Config.Transport is http.RoundTripper and *opensearchtransport.Client does not implement it; the canonical field for the router has been Config.Router since the routing system was introduced. Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent 9d7dee4 commit d87bb6e

2 files changed

Lines changed: 21 additions & 25 deletions

File tree

guides/routing.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,16 +2030,18 @@ client, _ := opensearch.NewClient(opensearch.Config{
20302030

20312031
Each policy type has a corresponding environment variable:
20322032

2033-
| Variable | Policy Type |
2034-
| -------------------------------------- | ---------------- |
2035-
| `OPENSEARCH_GO_POLICY_CHAIN` | PolicyChain |
2036-
| `OPENSEARCH_GO_POLICY_MUX` | MuxPolicy |
2037-
| `OPENSEARCH_GO_POLICY_IFENABLED` | IfEnabledPolicy |
2038-
| `OPENSEARCH_GO_POLICY_ROUTER` | poolRouter |
2039-
| `OPENSEARCH_GO_POLICY_ROLE` | RolePolicy |
2040-
| `OPENSEARCH_GO_POLICY_ROUNDROBIN` | RoundRobinPolicy |
2041-
| `OPENSEARCH_GO_POLICY_INDEX_ROUTER` | IndexRouter |
2042-
| `OPENSEARCH_GO_POLICY_DOCUMENT_ROUTER` | DocRouter |
2033+
| Variable | Policy Type |
2034+
| -------------------------------------- | ----------------- |
2035+
| `OPENSEARCH_GO_POLICY_CHAIN` | PolicyChain |
2036+
| `OPENSEARCH_GO_POLICY_MUX` | MuxPolicy |
2037+
| `OPENSEARCH_GO_POLICY_IFENABLED` | IfEnabledPolicy |
2038+
| `OPENSEARCH_GO_POLICY_ROUTER` | poolRouter |
2039+
| `OPENSEARCH_GO_POLICY_ROLE` | RolePolicy |
2040+
| `OPENSEARCH_GO_POLICY_ROUNDROBIN` | RoundRobinPolicy |
2041+
| `OPENSEARCH_GO_POLICY_COORDINATOR` | CoordinatorPolicy |
2042+
| `OPENSEARCH_GO_POLICY_NULL` | NullPolicy |
2043+
| `OPENSEARCH_GO_POLICY_INDEX_ROUTER` | IndexRouter |
2044+
| `OPENSEARCH_GO_POLICY_DOCUMENT_ROUTER` | DocRouter |
20432045

20442046
#### Value Format
20452047

guides/search.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ For search-heavy applications, you can configure the client to automatically rou
6464
DiscoverNodesInterval: 5 * time.Minute,
6565

6666
// Configure automatic routing to data nodes for search operations
67-
Transport: &opensearchtransport.Client{
68-
Router: router,
69-
},
67+
Router: router,
7068
})
7169
if err != nil {
7270
return err
@@ -311,15 +309,13 @@ For production search workloads, you can optimize performance by ensuring search
311309
DiscoverNodesInterval: 5 * time.Minute,
312310

313311
// Use data-preferred router for search optimization
314-
Transport: &opensearchtransport.Client{
315-
Router: opensearchtransport.NewRouter(
316-
func() opensearchtransport.Policy {
317-
policy, _ := opensearchtransport.NewRolePolicy(opensearchtransport.RoleData)
318-
return policy
319-
}(),
320-
opensearchtransport.NewRoundRobinPolicy(),
321-
),
322-
},
312+
Router: opensearchtransport.NewRouter(
313+
func() opensearchtransport.Policy {
314+
policy, _ := opensearchtransport.NewRolePolicy(opensearchtransport.RoleData)
315+
return policy
316+
}(),
317+
opensearchtransport.NewRoundRobinPolicy(),
318+
),
323319
})
324320
if err != nil {
325321
return err
@@ -360,9 +356,7 @@ The router automatically detects operation types and routes them to the most app
360356
DiscoverNodesOnStart: &discoverOnStart,
361357
DiscoverNodesInterval: 5 * time.Minute,
362358

363-
Transport: &opensearchtransport.Client{
364-
Router: router,
365-
},
359+
Router: router,
366360
})
367361
if err != nil {
368362
return err

0 commit comments

Comments
 (0)