Skip to content

Commit

Permalink
Code-samples for v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoocasali committed Aug 1, 2023
1 parent ba2756a commit 260a6d9
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@
# the documentation on build
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
---
facet_search_1: |-
$client->index('books')->facetSearch(
(new FacetSearchQuery())
->setFacetQuery('fiction')
->setFacetName('genres')
->setFilter(["rating > 3"])
);
facet_search_2: |-
$client->index('books')->updateFaceting(['sortFacetValuesBy' => ["genres" => "count"]]);
facet_search_3: |-
$client->index('books')->facetSearch(
(new FacetSearchQuery())
->setFacetQuery('c')
->setFacetName('genres')
);
search_parameter_guide_show_ranking_score_1: |-
$client->index('movies')->search('dragon', [
'showRankingScore' => true
]);
search_parameter_guide_attributes_to_search_on_1: |-
$client->index('movies')->search('adventure', [
'attributesToSearchOn' => ['overview']
]);
get_documents_post_1: |-
$client->index('books')->getDocuments(
(new DocumentsQuery())
Expand All @@ -15,7 +38,7 @@ delete_documents_by_filter_1: |-
get_documents_1: |-
$client->index('movies')->getDocuments((new DocumentsQuery())->setFilter('genres = action')->setLimit(2));
getting_started_faceting: |-
$client->index('movies')->updateFaceting(['maxValuesPerFacet' => 2]);
$client->index('movies')->updateFaceting(['maxValuesPerFacet' => 2, 'sortFacetValuesBy' => ['*' => 'count']]);
getting_started_pagination: |-
$client->index('movies')->updatePagination(['maxTotalHits' => 500]);
synonyms_guide_1: |-
Expand Down Expand Up @@ -656,7 +679,10 @@ reset_pagination_settings_1: |-
get_faceting_settings_1: |-
$client->index('books')->getFaceting();
update_faceting_settings_1: |-
$client->index('books')->updateFaceting([ 'maxValuesPerFacet' => 2 ]);
$client->index('books')->updateFaceting([
'maxValuesPerFacet' => 2,
'sortFacetValuesBy' => ['*' => 'alpha', 'genres' => 'count']
]);
reset_faceting_settings_1: |-
$client->index('books')->resetFaceting();
multi_search_1: |-
Expand Down

0 comments on commit 260a6d9

Please sign in to comment.