Skip to content

Commit f780851

Browse files
guides: push records.json location [skip-bc] (#4196) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 8904f51 commit f780851

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

docs/guides/csharp/src/pushSetup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PushSetup
1010
{
1111
public static async Task Main(string[] args)
1212
{
13-
string jsonContent = File.ReadAllText("/my-raw-records.json");
13+
string jsonContent = File.ReadAllText("records.json");
1414

1515
var records = JsonSerializer.Deserialize<List<PushTaskRecords>>(jsonContent);
1616

docs/guides/go/src/pushSetup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func push() {
1616
panic(err)
1717
}
1818

19-
content, err := os.ReadFile("/my-raw-records.json")
19+
content, err := os.ReadFile("records.json")
2020
if err != nil {
2121
panic(err)
2222
}

docs/guides/java/src/test/java/com/algolia/pushSetup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public class pushSetup {
99

1010
public static void main(String[] args) throws Exception {
11-
JsonNode content = new ObjectMapper().readTree(new File("/my-raw-records.json"));
11+
JsonNode content = new ObjectMapper().readTree(new File("records.json"));
1212
List<PushTaskRecords> records = new ObjectMapper().readerForListOf(Map.class).readValue(content);
1313

1414
// use the region matching your applicationID

docs/guides/javascript/src/pushSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initIn
88

99
try {
1010
// read local JSON file containing array of records
11-
const records = JSON.parse(fs.readFileSync('/my-raw-records.json', 'utf8')) as PushTaskRecords[];
11+
const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[];
1212

1313
// push records to the API
1414
const run = await client.pushTask({

docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import kotlinx.serialization.json.Json
88
import java.io.File
99

1010
suspend fun main() {
11-
val json = File("/my-raw-records.json").readText()
11+
val json = File("records.json").readText()
1212
val records: List<PushTaskRecords> = Json.decodeFromString(ListSerializer(PushTaskRecords.serializer()), json)
1313

1414
// use the region matching your applicationID

docs/guides/php/src/pushSetup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require __DIR__.'/vendor/autoload.php';
44
use Algolia\AlgoliaSearch\Api\IngestionClient;
55

6-
$records = json_decode(file_get_contents('/my-raw-records.json'), true);
6+
$records = json_decode(file_get_contents('records.json'), true);
77

88
// use the region matching your applicationID
99
$client = IngestionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION');

docs/guides/python/pushSetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async def main():
99
"ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION"
1010
)
1111

12-
with open("/my-raw-records.json") as f:
12+
with open("records.json") as f:
1313
records = json.load(f)
1414

1515
run = _client.push_task(

docs/guides/ruby/pushSetup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "json"
22
require "algolia"
33

4-
records = JSON.parse(File.read("/my-raw-records.json"))
4+
records = JSON.parse(File.read("records.json"))
55

66
# use the region matching your applicationID
77
client = Algolia::IngestionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION")

docs/guides/scala/src/main/scala/pushSetup.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object PushSetup {
1515
implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global
1616
implicit val formats: org.json4s.Formats = org.json4s.DefaultFormats
1717

18-
val result = Source.fromFile("/my-raw-records.json").getLines().mkString
18+
val result = Source.fromFile("records.json").getLines().mkString
1919
val records = JsonMethods.parse(result).extract[Seq[algoliasearch.ingestion.PushTaskRecords]]
2020

2121
// use the region matching your applicationID

docs/guides/swift/Sources/pushSetup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Ingestion
99
func pushSetup() async throws {
1010
do {
1111
let path = URL(string: #file)!.deletingLastPathComponent()
12-
.appendingPathComponent("/my-raw-records.json")
12+
.appendingPathComponent("records.json")
1313
let data = try Data(contentsOf: URL(fileURLWithPath: path.absoluteString))
1414
let records = try JSONDecoder().decode([PushTaskRecords].self, from: data)
1515

0 commit comments

Comments
 (0)