Skip to content

Commit

Permalink
Merge pull request #211 from meilisearch/code-sample
Browse files Browse the repository at this point in the history
Add code-sample for v0.23.0
  • Loading branch information
alallema authored Oct 11, 2021
2 parents 1e1eccb + 1aac34f commit 45c99b1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,34 @@ search_parameter_guide_sort_1: |-
"price:asc",
},
})
geosearch_guide_filter_settings_1: |-
filterableAttributes := []string{
"_geo",
}
client.Index("restaurants").UpdateFilterableAttributes(&filterableAttributes)
geosearch_guide_filter_usage_1: |-
resp, err := client.Index("restaurants").Search("", &meilisearch.SearchRequest{
Filter: "_geoRadius(45.4628328, 9.1076931, 2000)",
})
geosearch_guide_filter_usage_2: |-
resp, err := client.Index("restaurants").Search("", &meilisearch.SearchRequest{
Filter: "_geoRadius(45.4628328, 9.1076931, 2000) AND type = pizza",
})
geosearch_guide_sort_settings_1: |-
sortableAttributes := []string{
"_geo",
}
client.Index("restaurants").UpdateSortableAttributes(&sortableAttributes)
geosearch_guide_sort_usage_1: |-
resp, err := client.Index("restaurants").Search("", &meilisearch.SearchRequest{
Sort: []string{
"_geoPoint(48.8583701,2.2922926):asc",
},
})
geosearch_guide_sort_usage_2: |-
resp, err := client.Index("restaurants").Search("", &meilisearch.SearchRequest{
Sort: []string{
"_geoPoint(48.8583701,2.2922926):asc",
"rating:desc",
},
})

0 comments on commit 45c99b1

Please sign in to comment.