Skip to content

Commit 0d7bdca

Browse files
authored
Merge branch 'main' into meili-bot/docker
2 parents f5339c6 + 08b720f commit 0d7bdca

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

.code-samples.meilisearch.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ getting_started_add_meteorites: |-
444444
Client client = new Client(new Config("http://127.0.0.1:7700", "masterKey"));
445445
446446
client.index("meteorites").addDocuments(meteoritesJson);
447-
getting_started_update_rankingRules: |-
447+
getting_started_update_ranking_rules: |-
448448
Settings settings = new Settings();
449449
settings.setRankingRules(new String[]
450450
{
@@ -458,7 +458,7 @@ getting_started_update_rankingRules: |-
458458
"rank:desc"
459459
});
460460
client.index("movies").updateSettings(settings);
461-
getting_started_update_displayedAttributes: |-
461+
getting_started_update_displayed_attributes: |-
462462
Settings settings = new Settings();
463463
settings.setDisplayedAttributes(new String[]
464464
{
@@ -467,7 +467,7 @@ getting_started_update_displayedAttributes: |-
467467
"poster"
468468
});
469469
client.index("movies").updateSettings(settings);
470-
getting_started_update_searchableAttributes: |-
470+
getting_started_update_searchable_attributes: |-
471471
Settings settings = new Settings();
472472
settings.setSearchableAttributes(new String[]
473473
{
@@ -491,11 +491,11 @@ getting_started_filtering: |-
491491
SearchRequest searchRequest =
492492
new SearchRequest("").setFilter(new String[] {"mass < 200"});
493493
client.index("meteorites").search(searchRequest);
494-
getting_started_geoRadius: |-
494+
getting_started_geo_radius: |-
495495
SearchRequest searchRequest =
496496
new SearchRequest("").setFilter(new String[] {"_geoRadius(46.9480, 7.4474, 210000)"});
497497
client.index("meteorites").search(searchRequest);
498-
getting_started_geoPoint: |-
498+
getting_started_geo_point: |-
499499
SearchRequest searchRequest =
500500
new SearchRequest("").setSort(new String[] {"_geoPoint(48.8583701,2.2922926):asc"});
501501
client.index("meteorites").search(searchRequest);
@@ -624,15 +624,17 @@ geosearch_guide_sort_usage_2: |-
624624
"rating:desc",
625625
});
626626
client.index("restaurants").search(searchRequest);
627-
document_guide_create_index_primary_key: |-
628-
client.createIndex("movies", "reference_number");
629-
document_guide_add_document_primary_key: |-
630-
client.index("movies").addDocuments("[{"
631-
+ "\"reference_number\": 287947,"
632-
+ "\"title\": \"Shazam\","
633-
+ "\"poster\": \"https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg\","
634-
+ "\"overview\": \"A boy is given the ability to become an adult superhero in times of need with a single magic word.\","
635-
+ "\"release_date\": \"2019-03-23\""
627+
primary_field_guide_update_document_primary_key: |-
628+
client.updateIndex("books", "title");
629+
primary_field_guide_create_index_primary_key: |-
630+
client.createIndex("books", "reference_number");
631+
primary_field_guide_add_document_primary_key: |-
632+
client.index("books").addDocuments("[{"
633+
+ "\"reference_number\": 2879,"
634+
+ "\"title\": \"Diary of a Wimpy Kid\","
635+
+ "\"author\": \"Jeff Kinney\","
636+
+ "\"genres\": [\"comedy\", \"humor\"],"
637+
+ "\"price\": 5.00"
636638
+ "}]"
637639
, "reference_number");
638640
security_guide_search_key_1: |-

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ class TestMeilisearch {
9999

100100
JSONArray array = new JSONArray();
101101
ArrayList items = new ArrayList() {{
102-
add(new JSONObject().put("id", "1").put("title", "Carol").put("genre",new JSONArray("[\"Romance\",\"Drama\"]")));
103-
add(new JSONObject().put("id", "2").put("title", "Wonder Woman").put("genre",new JSONArray("[\"Action\",\"Adventure\"]")));
104-
add(new JSONObject().put("id", "3").put("title", "Life of Pi").put("genre",new JSONArray("[\"Adventure\",\"Drama\"]")));
105-
add(new JSONObject().put("id", "4").put("title", "Mad Max: Fury Road").put("genre",new JSONArray("[\"Adventure\",\"Science Fiction\"]")));
106-
add(new JSONObject().put("id", "5").put("title", "Moana").put("genre",new JSONArray("[\"Fantasy\",\"Action\"]")));
107-
add(new JSONObject().put("id", "6").put("title", "Philadelphia").put("genre",new JSONArray("[\"Drama\"]")));
102+
add(new JSONObject().put("id", "1").put("title", "Carol").put("genres",new JSONArray("[\"Romance\",\"Drama\"]")));
103+
add(new JSONObject().put("id", "2").put("title", "Wonder Woman").put("genres",new JSONArray("[\"Action\",\"Adventure\"]")));
104+
add(new JSONObject().put("id", "3").put("title", "Life of Pi").put("genres",new JSONArray("[\"Adventure\",\"Drama\"]")));
105+
add(new JSONObject().put("id", "4").put("title", "Mad Max: Fury Road").put("genres",new JSONArray("[\"Adventure\",\"Science Fiction\"]")));
106+
add(new JSONObject().put("id", "5").put("title", "Moana").put("genres",new JSONArray("[\"Fantasy\",\"Action\"]")));
107+
add(new JSONObject().put("id", "6").put("title", "Philadelphia").put("genres",new JSONArray("[\"Drama\"]")));
108108
}};
109109

110110
array.put(items);
@@ -137,7 +137,7 @@ System.out.println(results);
137137
- Output:
138138

139139
```
140-
SearchResult(hits=[{id=1.0, title=Carol, genre:[Romance, Drama]}], offset=0, limit=20, nbHits=1, exhaustiveNbHits=false, facetsDistribution=null, exhaustiveFacetsCount=false, processingTimeMs=3, query=carlo)
140+
SearchResult(hits=[{id=1.0, title=Carol, genres:[Romance, Drama]}], offset=0, limit=20, nbHits=1, exhaustiveNbHits=false, facetsDistribution=null, exhaustiveFacetsCount=false, processingTimeMs=3, query=carlo)
141141
```
142142

143143
#### Custom Search <!-- omit in toc -->
@@ -164,11 +164,11 @@ System.out.println(results.getHits());
164164
[{
165165
"id":3,
166166
"title":"Life of Pi",
167-
"genre":["Adventure","Drama"],
167+
"genres":["Adventure","Drama"],
168168
"_formatted":{
169169
"id":3,
170170
"title":"Life <em>of</em> Pi",
171-
"genre":["Adventure","Drama"]
171+
"genres":["Adventure","Drama"]
172172
},
173173
"_matchesInfo":{
174174
"title":[{

0 commit comments

Comments
 (0)