Skip to content

Commit

Permalink
Merge #330
Browse files Browse the repository at this point in the history
330: Add pagination setting code samples and fix code sample typos r=alallema a=GoryMoon

Based on the comments from #329 this adds code samples for the pagination settings added in #328.

It also includes some typo fixes from the additions in #294.


Co-authored-by: GoryMoon <gurreja@gmail.com>
  • Loading branch information
bors[bot] and GoryMoon authored Jul 26, 2022
2 parents 10bac16 + 809d837 commit c5a7804
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,17 @@ update_settings_1: |-
"logan": []string{"wolverine"},
},
TypoTolerance: &meilisearch.TypoTolerance{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
OneTypo: 8,
TwoTypos: 10,
},
DisableOnAttributes: []string{"title"},
},
Pagination: &meilisearch.Pagination{
MaxTotalHits: 5000,
},
Faceting: &meilisearch.Faceting{
MaxValuesPerFacet: 200
MaxValuesPerFacet: 200,
},
}
client.Index("movies").UpdateSettings(&settings)
Expand Down Expand Up @@ -228,14 +231,22 @@ get_typo_tolerance_1:
client.Index("books").GetTypoTolerance()
update_typo_tolerance_1: |-
client.Index("books").UpdateTypoTolerance(&meilisearch.TypoTolerance{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
OneTypo: 4,
TwoTypos: 10,
},
DisableOnAttributes: []string{"title"},
})
reset_typo_tolerance_1: |-
client.Index("books").ResetTypoTolerance()
get_pagination_settings_1:
client.Index("books").GetPagination()
update_pagination_settings_1: |-
client.Index("books").UpdatePagination(&meilisearch.Pagination{
MaxTotalHits: 100,
})
reset_pagination_settings_1: |-
client.Index("books").ResetPagination()
get_faceting_settings_1:
client.Index("books").GetFaceting()
update_faceting_settings_1: |-
Expand Down Expand Up @@ -383,13 +394,17 @@ settings_guide_sortable_1: |-
},
}
client.Index("books").UpdateSettings(&settings)
settings_guide_pagination_1: |-
client.Index("movies").UpdatePagination(&meilisearch.Pagination{
MaxTotalHits: 50,
})
settings_guide_faceting_1: |-
client.Index("movies").UpdateFaceting(&meilisearch.Faceting{
MaxValuesPerFacet: 5
MaxValuesPerFacet: 5,
})
settings_guide_typo_tolerance_1: |-
client.index("movies").UpdateTypoTolerance({
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
TwoTypos: 12,
},
DisableOnAttributes: []string{"title"},
Expand All @@ -408,7 +423,7 @@ typo_tolerance_guide_3: |-
})
typo_tolerance_guide_4: |-
client.index("movies").UpdateTypoTolerance({
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypos{
OneTypo: 4,
TwoTypos: 10,
},
Expand Down

0 comments on commit c5a7804

Please sign in to comment.