Skip to content

Commit 75ccb18

Browse files
committed
cleanup setup code
1 parent 17bef8c commit 75ccb18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

solutions/search/get-started/index-basics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import os
5757
from elasticsearch import Elasticsearch
5858

5959
client = Elasticsearch(
60-
hosts=["$ELASTICSEARCH_URL"],
60+
hosts=[os.getenv("ELASTICSEARCH_URL")],
6161
api_key=os.getenv("ELASTIC_API_KEY"),
6262
)
6363

@@ -74,7 +74,7 @@ resp = client.indices.create(
7474
const { Client } = require("@elastic/elasticsearch");
7575

7676
const client = new Client({
77-
nodes: ["$ELASTICSEARCH_URL"],
77+
nodes: [process.env["ELASTICSEARCH_URL"]],
7878
auth: {
7979
apiKey: process.env["ELASTIC_API_KEY"],
8080
},
@@ -100,7 +100,7 @@ require(__DIR__ . "/vendor/autoload.php");
100100
use Elastic\Elasticsearch\ClientBuilder;
101101

102102
$client = ClientBuilder::create()
103-
->setHosts(["$ELASTICSEARCH_URL"])
103+
->setHosts([getenv("ELASTICSEARCH_URL")])
104104
->setApiKey(getenv("ELASTIC_API_KEY"))
105105
->build();
106106

@@ -117,7 +117,7 @@ $resp = $client->indices()->create([
117117
require "elasticsearch"
118118

119119
client = Elasticsearch::Client.new(
120-
host: "$ELASTICSEARCH_URL",
120+
host: ENV["ELASTICSEARCH_URL"],
121121
api_key: ENV["ELASTIC_API_KEY"]
122122
)
123123

solutions/search/get-started/semantic-search.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import os
7474
from elasticsearch import Elasticsearch
7575

7676
client = Elasticsearch(
77-
hosts=["$ELASTICSEARCH_URL"],
77+
hosts=[os.getenv("ELASTICSEARCH_URL")],
7878
api_key=os.getenv("ELASTIC_API_KEY"),
7979
)
8080

@@ -91,7 +91,7 @@ resp = client.indices.create(
9191
const { Client } = require("@elastic/elasticsearch");
9292

9393
const client = new Client({
94-
nodes: ["$ELASTICSEARCH_URL"],
94+
nodes: [process.env["ELASTICSEARCH_URL"]],
9595
auth: {
9696
apiKey: process.env["ELASTIC_API_KEY"],
9797
},
@@ -117,7 +117,7 @@ require(__DIR__ . "/vendor/autoload.php");
117117
use Elastic\Elasticsearch\ClientBuilder;
118118

119119
$client = ClientBuilder::create()
120-
->setHosts(["$ELASTICSEARCH_URL"])
120+
->setHosts([getenv("ELASTICSEARCH_URL")])
121121
->setApiKey(getenv("ELASTIC_API_KEY"))
122122
->build();
123123

@@ -134,7 +134,7 @@ $resp = $client->indices()->create([
134134
require "elasticsearch"
135135

136136
client = Elasticsearch::Client.new(
137-
host: "$ELASTICSEARCH_URL",
137+
host: ENV["ELASTICSEARCH_URL"],
138138
api_key: ENV["ELASTIC_API_KEY"]
139139
)
140140

0 commit comments

Comments
 (0)