From 1aac34f6a924ae0fb9e2eb684f565723d7a9e3d7 Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 11 Oct 2021 11:55:58 +0200 Subject: [PATCH] Add code-sample for v0.23.0 --- .code-samples.meilisearch.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 11db4a9d..6bf0b128 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -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", + }, + })