Skip to content

Commit

Permalink
Update code_samples
Browse files Browse the repository at this point in the history
  • Loading branch information
alallema committed Sep 7, 2021
1 parent c3f6174 commit 7e31043
Showing 1 changed file with 53 additions and 6 deletions.
59 changes: 53 additions & 6 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ update_settings_1: |-
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"desc(release_date)",
"desc(rank)",
"release_date:desc",
"rank:desc",
},
DistinctAttribute: &distinctAttribute,
SearchableAttributes: []string{
Expand Down Expand Up @@ -130,9 +131,10 @@ update_ranking_rules_1: |-
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"asc(release_date)",
"desc(rank)",
"release_date:asc",
"rank:desc",
}
client.Index("movies").UpdateRankingRules(&rankingRules)
reset_ranking_rules_1: |-
Expand Down Expand Up @@ -176,6 +178,16 @@ update_displayed_attributes_1: |-
client.Index("movies").UpdateDisplayedAttributes(&displayedAttributes)
reset_displayed_attributes_1: |-
client.Index("movies").ResetDisplayedAttributes()
sortable_attributes_get_1: |-
client.Index("books").GetSortableAttributes()
sortable_attributes_update_1: |-
sortableAttributes := []string{
"price",
"author",
}
client.Index("books").UpdateSortableAttributes(&sortableAttributes)
sortable_attributes_reset_1: |-
client.Index("books").ResetSortableAttributes()
get_index_stats_1: |-
client.Index("movies").GetStats()
get_indexes_stats_1: |-
Expand Down Expand Up @@ -267,9 +279,10 @@ settings_guide_ranking_rules_1: |-
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"asc(release_date)",
"desc(rank)",
"release_date:asc",
"rank:desc",
}
client.Index("movies").UpdateRankingRules(&rankingRules)
settings_guide_distinct_1: |-
Expand Down Expand Up @@ -408,3 +421,37 @@ get_dump_status_1: |-
resp, err := client.GetDumpStatus("dump-uid")
phrase_search_1: |-
resp, err := client.Index("movies").Search("\"african american\" horror", &meilisearch.SearchRequest{})
sorting_guide_update_sortable_attributes_1: |-
sortableAttributes := []string{
"author",
"price",
}
client.Index("books").UpdateSortableAttributes(&sortableAttributes)
sorting_guide_update_ranking_rules_1: |-
rankingRules := []string{
"words",
"sort",
"typo",
"proximity",
"attribute",
"exactness",
}
client.Index("books").UpdateRankingRules(&rankingRules)
sorting_guide_sort_parameter_1: |-
resp, err := client.Index("books").Search("science fiction", &meilisearch.SearchRequest{
Sort: []string{
"price:asc",
},
})
sorting_guide_sort_parameter_2: |-
resp, err := client.Index("books").Search("butler", &meilisearch.SearchRequest{
Sort: []string{
"author:desc",
},
})
search_parameter_guide_sort_1: |-
resp, err := client.Index("books").Search("science fiction", &meilisearch.SearchRequest{
Sort: []string{
"price:asc",
},
})

0 comments on commit 7e31043

Please sign in to comment.