Skip to content

Commit af0142c

Browse files
committed
fix templates
1 parent 3001a9d commit af0142c

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

templates/go/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ func main() {
3939
return
4040
}
4141

42-
fmt.Println(fmt.Sprintf("Done! Uploaded records in %d batches.", len(result)))
42+
fmt.Printf("Done! Uploaded records in %d batches.", len(result))
4343
}

templates/java/guides/search/saveObjectsMovies.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ import com.fasterxml.jackson.core.type.TypeReference;
99
import com.fasterxml.jackson.databind.JsonNode;
1010
import com.fasterxml.jackson.databind.ObjectMapper;
1111

12-
public class Main {
12+
public class saveObjectsMovies {
1313
public static void main(String[] args) throws Exception {
1414
// Fetch sample dataset
1515
URL url = new URI("https://dashboard.algolia.com/sample_datasets/movie.json").toURL();
1616
InputStream stream = url.openStream();
1717
ObjectMapper mapper = new ObjectMapper();
18-
List<JsonNode> result = mapper.readValue(stream, new TypeReference<List<JsonNode>>() {});
18+
List<JsonNode> movies = mapper.readValue(stream, new TypeReference<List<JsonNode>>() {});
1919
stream.close();
2020

2121
// Connect and authenticate with your Algolia app
2222
{{> snippets/init}}
2323

2424
// Save records in Algolia index
25-
{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
25+
{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}};
2626
client.close();
2727
}
2828
}

templates/javascript/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Fetch and index objects in Algolia
66
const processRecords = async () => {
77
const datasetRequest = await fetch('https://dashboard.algolia.com/sample_datasets/movie.json');
8-
const objects = await datasetRequest.json();
8+
const movies = await datasetRequest.json();
99
return {{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
1010
};
1111

templates/kotlin/guides/search/saveObjectsMovies.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import java.net.URI
88
suspend fun main() {
99
val url = URI.create("https://dashboard.algolia.com/sample_datasets/movie.json")
1010
val json = url.toURL().readText()
11-
val records: List<JsonObject> = Json.decodeFromString(ListSerializer(JsonObject.serializer()), json)
11+
val movies: List<JsonObject> = Json.decodeFromString(ListSerializer(JsonObject.serializer()), json)
1212
1313
{{> snippets/init}}
1414

1515
try {
16-
{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
16+
client.{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
1717
} catch(e: Exception) {
1818
println(e.message)
1919
}

templates/php/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require(__DIR__."/vendor/autoload.php");
55
// Fetch sample dataset
66
$url = "https://dashboard.algolia.com/sample_datasets/movie.json";
77
$response = file_get_contents($url);
8-
$records = json_decode($response, true);
8+
$movies = json_decode($response, true);
99

1010
// Connect and authenticate with your Algolia app
1111
{{> snippets/init}}

templates/python/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import requests
33

44
# Fetch sample dataset
55
url = "https://dashboard.algolia.com/sample_datasets/movie.json"
6-
records = requests.get(url).json()
6+
movies = requests.get(url).json()
77

88
# Connect and authenticate with your Algolia app
99
{{> snippets/init}}

templates/ruby/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require 'uri'
44
# Fetch sample dataset
55
uri = URI('https://dashboard.algolia.com/sample_datasets/movie.json')
66
response = Net::HTTP.get_response(uri)
7-
records = JSON.parse(response.body)
7+
movies = JSON.parse(response.body)
88

99
# Connect and authenticate with your Algolia app
1010
{{> snippets/init}}

templates/scala/guides/search/saveObjectsMovies.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object Main {
1515
// Fetch sample dataset
1616
val url = "https://dashboard.algolia.com/sample_datasets/movie.json"
1717
val result = Source.fromURL(url).mkString
18-
val records = JsonMethods.parse(result).extract[Seq[Map[String, Any]]]
18+
val movies = JsonMethods.parse(result).extract[Seq[Map[String, Any]]]
1919
2020
// Connect and authenticate with your Algolia app
2121
{{> snippets/init}}

0 commit comments

Comments
 (0)