Skip to content

Commit 7d6e44a

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 7d6e44a

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

guides/routing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,8 @@ Each policy type has a corresponding environment variable:
20382038
| `OPENSEARCH_GO_POLICY_ROUTER` | poolRouter |
20392039
| `OPENSEARCH_GO_POLICY_ROLE` | RolePolicy |
20402040
| `OPENSEARCH_GO_POLICY_ROUNDROBIN` | RoundRobinPolicy |
2041+
| `OPENSEARCH_GO_POLICY_COORDINATOR` | CoordinatorPolicy |
2042+
| `OPENSEARCH_GO_POLICY_NULL` | NullPolicy |
20412043
| `OPENSEARCH_GO_POLICY_INDEX_ROUTER` | IndexRouter |
20422044
| `OPENSEARCH_GO_POLICY_DOCUMENT_ROUTER` | DocRouter |
20432045

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)