diff --git a/docs/guides/csharp/src/pushSetup.cs b/docs/guides/csharp/src/pushSetup.cs index 64b4ef92e1..a5084db2cd 100644 --- a/docs/guides/csharp/src/pushSetup.cs +++ b/docs/guides/csharp/src/pushSetup.cs @@ -10,7 +10,7 @@ class PushSetup { public static async Task Main(string[] args) { - string jsonContent = File.ReadAllText("/my-raw-records.json"); + string jsonContent = File.ReadAllText("records.json"); var records = JsonSerializer.Deserialize>(jsonContent); diff --git a/docs/guides/go/src/pushSetup.go b/docs/guides/go/src/pushSetup.go index e222be39f8..291d644bcd 100644 --- a/docs/guides/go/src/pushSetup.go +++ b/docs/guides/go/src/pushSetup.go @@ -16,7 +16,7 @@ func push() { panic(err) } - content, err := os.ReadFile("/my-raw-records.json") + content, err := os.ReadFile("records.json") if err != nil { panic(err) } diff --git a/docs/guides/java/src/test/java/com/algolia/pushSetup.java b/docs/guides/java/src/test/java/com/algolia/pushSetup.java index a42f7bb0c1..683b3c69e9 100644 --- a/docs/guides/java/src/test/java/com/algolia/pushSetup.java +++ b/docs/guides/java/src/test/java/com/algolia/pushSetup.java @@ -8,7 +8,7 @@ public class pushSetup { public static void main(String[] args) throws Exception { - JsonNode content = new ObjectMapper().readTree(new File("/my-raw-records.json")); + JsonNode content = new ObjectMapper().readTree(new File("records.json")); List records = new ObjectMapper().readerForListOf(Map.class).readValue(content); // use the region matching your applicationID diff --git a/docs/guides/javascript/src/pushSetup.ts b/docs/guides/javascript/src/pushSetup.ts index 242d9d2297..5187277828 100644 --- a/docs/guides/javascript/src/pushSetup.ts +++ b/docs/guides/javascript/src/pushSetup.ts @@ -8,7 +8,7 @@ const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initIn try { // read local JSON file containing array of records - const records = JSON.parse(fs.readFileSync('/my-raw-records.json', 'utf8')) as PushTaskRecords[]; + const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[]; // push records to the API const run = await client.pushTask({ diff --git a/docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt b/docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt index 4d58d7ae69..9f9b3be6c7 100644 --- a/docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt +++ b/docs/guides/kotlin/src/main/kotlin/com/algolia/snippets/pushSetup.kt @@ -8,7 +8,7 @@ import kotlinx.serialization.json.Json import java.io.File suspend fun main() { - val json = File("/my-raw-records.json").readText() + val json = File("records.json").readText() val records: List = Json.decodeFromString(ListSerializer(PushTaskRecords.serializer()), json) // use the region matching your applicationID diff --git a/docs/guides/php/src/pushSetup.php b/docs/guides/php/src/pushSetup.php index e65c4aa090..c60a19f854 100644 --- a/docs/guides/php/src/pushSetup.php +++ b/docs/guides/php/src/pushSetup.php @@ -3,7 +3,7 @@ require __DIR__.'/vendor/autoload.php'; use Algolia\AlgoliaSearch\Api\IngestionClient; -$records = json_decode(file_get_contents('/my-raw-records.json'), true); +$records = json_decode(file_get_contents('records.json'), true); // use the region matching your applicationID $client = IngestionClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY', 'ALGOLIA_APPLICATION_REGION'); diff --git a/docs/guides/python/pushSetup.py b/docs/guides/python/pushSetup.py index 9f67add0f2..040a67ae2e 100644 --- a/docs/guides/python/pushSetup.py +++ b/docs/guides/python/pushSetup.py @@ -9,7 +9,7 @@ async def main(): "ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION" ) - with open("/my-raw-records.json") as f: + with open("records.json") as f: records = json.load(f) run = _client.push_task( diff --git a/docs/guides/ruby/pushSetup.rb b/docs/guides/ruby/pushSetup.rb index 83acf47ed1..43ec9fd0ae 100644 --- a/docs/guides/ruby/pushSetup.rb +++ b/docs/guides/ruby/pushSetup.rb @@ -1,7 +1,7 @@ require "json" require "algolia" -records = JSON.parse(File.read("/my-raw-records.json")) +records = JSON.parse(File.read("records.json")) # use the region matching your applicationID client = Algolia::IngestionClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY", "ALGOLIA_APPLICATION_REGION") diff --git a/docs/guides/scala/src/main/scala/pushSetup.scala b/docs/guides/scala/src/main/scala/pushSetup.scala index 88cff418c8..af1e8495c7 100644 --- a/docs/guides/scala/src/main/scala/pushSetup.scala +++ b/docs/guides/scala/src/main/scala/pushSetup.scala @@ -15,7 +15,7 @@ object PushSetup { implicit val ec: ExecutionContextExecutor = scala.concurrent.ExecutionContext.global implicit val formats: org.json4s.Formats = org.json4s.DefaultFormats - val result = Source.fromFile("/my-raw-records.json").getLines().mkString + val result = Source.fromFile("records.json").getLines().mkString val records = JsonMethods.parse(result).extract[Seq[algoliasearch.ingestion.PushTaskRecords]] // use the region matching your applicationID diff --git a/docs/guides/swift/Sources/pushSetup.swift b/docs/guides/swift/Sources/pushSetup.swift index 6e422ee3d0..294ea4730a 100644 --- a/docs/guides/swift/Sources/pushSetup.swift +++ b/docs/guides/swift/Sources/pushSetup.swift @@ -9,7 +9,7 @@ import Ingestion func pushSetup() async throws { do { let path = URL(string: #file)!.deletingLastPathComponent() - .appendingPathComponent("/my-raw-records.json") + .appendingPathComponent("records.json") let data = try Data(contentsOf: URL(fileURLWithPath: path.absoluteString)) let records = try JSONDecoder().decode([PushTaskRecords].self, from: data)