Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ update_settings_1: |-
"wolverine": []string{"xmen", "logan"},
"logan": []string{"wolverine"},
},
TypoTolerance: &meilisearch.TypoTolerance{
Enabled: true,
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
OneTypo: 8,
TwoTypos: 10,
},
DisableOnWords: []string{},
DisableOnAttributes: []string{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the line above 129, we have a one-line array declaration, what do you think to do that here as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, this has a different version than: https://github.com/meilisearch/documentation/pull/1606/files#diff-65d25ef75b16ef426e9e9d93d4ab97e174f75dd16ca8e4c0d7f4b7ca03173516R178-R186

it is because of the nature of the GoLang, or just a misunderstood?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean it's better this way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You fixed it :)

I was talking about DisableOnWords which is not required in the documentation repo :)

"title",
},
},
}
client.Index("movies").UpdateSettings(&settings)
reset_settings_1: |-
Expand Down Expand Up @@ -214,6 +225,20 @@ update_sortable_attributes_1: |-
client.Index("books").UpdateSortableAttributes(&sortableAttributes)
reset_sortable_attributes_1: |-
client.Index("books").ResetSortableAttributes()
get_typo_tolerance_1:
client.Index("books").GetTypoTolerance()
update_typo_tolerance_1: |-
client.Index("books").UpdateTypoTolerance(&meilisearch.TypoTolerance{
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
OneTypo: 4,
TwoTypos: 10,
},
DisableOnAttributes: []string{
"title",
},
})
reset_typo_tolerance_1: |-
client.Index("books").ResetTypoTolerance()
get_index_stats_1: |-
client.Index("movies").GetStats()
get_indexes_stats_1: |-
Expand Down Expand Up @@ -266,14 +291,25 @@ search_parameter_guide_retrieve_1: |-
AttributesToRetrieve: []string{"overview", "title"},
})
search_parameter_guide_crop_1: |-
resp, err := client.Index("movies").Search("shifu" &meilisearch.SearchRequest{
resp, err := client.Index("movies").Search("shifu", &meilisearch.SearchRequest{
AttributesToCrop: []string{"overview"},
CropLength: 10,
CropLength: 5,
})
search_parameter_guide_crop_marker_1: |-
resp, err := client.Index("movies").Search("shifu", &meilisearch.SearchRequest{
AttributesToCrop: []string{"overview"},
CropMarker: "[…]",
})
search_parameter_guide_highlight_1: |-
resp, err := client.Index("movies").Search("winter feast", &meilisearch.SearchRequest{
AttributesToHighlight: []string{"overview"},
})
search_parameter_guide_highlight_tag_1: |-
resp, err := client.Index("movies").Search("winter feast", &meilisearch.SearchRequest{
AttributesToHighlight: []string{"overview"},
HighlightPreTag: "<span class=\"highlight\">",
HighlightPostTag: "</span>",
})
search_parameter_guide_matches_1: |-
resp, err := client.Index("movies").Search("winter feast", &meilisearch.SearchRequest{
Matches: true,
Expand Down Expand Up @@ -342,6 +378,38 @@ settings_guide_sortable_1: |-
},
}
client.Index("books").UpdateSettings(&settings)
settings_guide_typo_tolerance_1: |-
client.index("movies").UpdateTypoTolerance({
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
TwoTypos: 12,
},
DisableOnAttributes: []string{
"title",
},
})
typo_tolerance_guide_1: |-
client.index("movies").UpdateTypoTolerance({
Enabled: false,
})
typo_tolerance_guide_2: |-
client.index("movies").UpdateTypoTolerance({
DisableOnAttributes: []string{
"title",
},
})
typo_tolerance_guide_3: |-
client.index("movies").UpdateTypoTolerance({
DisableOnWords: []string{
"shrek",
},
})
typo_tolerance_guide_4: |-
client.index("movies").UpdateTypoTolerance({
MinWordSizeForTypos: meilisearch.MinWordSizeForTypo{
OneTypo: 4,
TwoTypos: 10,
},
})
add_movies_json_1: |-
import (
"encoding/json"
Expand Down