Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion reference/api/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,9 @@ Excludes results below the specified ranking score.
Excluded results do not count towards `estimatedTotalHits`, `totalHits`, and facet distribution.

<Warning>
For performance reasons, if the number of documents above `rankingScoreThreshold` is higher than `limit`, Meilisearch does not evaluate the ranking score of the remaining documents. Results ranking below the threshold are not immediately removed from the set of candidates. In this case, Meilisearch may overestimate the count of `estimatedTotalHits`, `totalHits` and facet distribution.
Using `rankingScoreThreshold` with `page` and `hitsPerPage` forces Meilisearch to evaluate the ranking score of all matching documents to return an accurate `totalHits`. This may negatively impact search performance.

Queries with `limit` and `offset` avoid this overhead when using `rankingScoreThreshold`.
</Warning>

#### Example
Expand Down
2 changes: 1 addition & 1 deletion snippets/samples/code_samples_add_movies_json_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ file, _ := os.ReadFile("movies.json")
var movies interface{}
json.Unmarshal([]byte(file), &movies)

client.Index("movies").AddDocuments(&movies)
client.Index("movies").AddDocuments(&movies, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ documents := []map[string]interface{}{
"release_date": "2019-03-23",
},
}
client.Index("movies").AddDocuments(documents)
client.Index("movies").AddDocuments(documents, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ documents := []map[string]interface{}{
"genres": "comedy",
},
}
client.Index("movies").UpdateDocuments(documents)
client.Index("movies").UpdateDocuments(documents, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ client.index('games').update_filterable_attributes(['release_timestamp'])
```

```go Go
filterableAttributes := []string{"release_timestamp"}
filterableAttributes := []interface{}{"release_timestamp"}
client.Index("games").UpdateFilterableAttributes(&filterableAttributes)
```

Expand Down
2 changes: 1 addition & 1 deletion snippets/samples/code_samples_date_guide_index_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ byteValue, _ := io.ReadAll(jsonFile)
var games []map[string]interface{}
json.Unmarshal(byteValue, &games)

client.Index("games").AddDocuments(games)
client.Index("games").AddDocuments(games, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ client.index('products').update_filterable_attributes([
```

```go Go
filterableAttributes := []string{
filterableAttributes := []interface{}{
"product_id",
"sku",
"url",
Expand Down
1 change: 1 addition & 0 deletions snippets/samples/code_samples_facet_search_3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ client.index('books').facet_search('genres', 'c')
client.Index("books").FacetSearch(&meilisearch.FacetSearchRequest{
FacetQuery: "c",
FacetName: "genres",
ExhaustiveFacetCount: true
})
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ client.index('movie_ratings').update_filterable_attributes(['genres', 'rating',
```

```go Go
filterableAttributes := []string{
filterableAttributes := []interface{}{
"genres",
"rating",
"language",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ client.index('movies').update_filterable_attributes([
```

```go Go
resp, err := client.Index("movies").UpdateFilterableAttributes(&[]string{
resp, err := client.Index("movies").UpdateFilterableAttributes(&[]interface{}{
"director",
"genres",
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ client.index('restaurants').update_filterable_attributes(['_geo'])
```

```go Go
filterableAttributes := []string{
filterableAttributes := []interface{}{
"_geo",
}
client.Index("restaurants").UpdateFilterableAttributes(&filterableAttributes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func main() {
var movies []map[string]interface{}
json.Unmarshal(byteValue, &movies)

_, err := client.Index("movies").AddDocuments(movies)
_, err := client.Index("movies").AddDocuments(movies, nil)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -192,7 +192,7 @@ namespace Meilisearch_demo
```text Rust
// In your .toml file:
[dependencies]
meilisearch-sdk = "0.29.0"
meilisearch-sdk = "0.29.1"
# futures: because we want to block on futures
futures = "0.3"
# serde: required if you are going to use documents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ byteValue, _ := io.ReadAll(jsonFile)
var meteorites []map[string]interface{}
json.Unmarshal(byteValue, &meteorites)

client.Index("meteorites").AddDocuments(meteorites)
client.Index("meteorites").AddDocuments(meteorites, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ documents := []map[string]interface{}{
{ "id": 5, "title": "Moana" },
{ "id": 6, "title": "Philadelphia" },
}
client.Index("movies").AddDocuments(documents)
client.Index("movies").AddDocuments(documents, nil)
```

```csharp C#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ documents := []map[string]interface{}{
"price": 5.00,
},
}
client.Index("books").AddDocuments(documents, "reference_number")
refrenceNumber := "reference_number"
client.Index("books").AddDocuments(documents, &refrenceNumber)
```

```csharp C#
Expand Down
6 changes: 6 additions & 0 deletions snippets/samples/code_samples_typo_tolerance_guide_5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ $client->index('movies')->updateTypoTolerance([
'disableOnNumbers' => true
]);
```

```go Go
client.Index("movies").UpdateTypoTolerance(&meilisearch.TypoTolerance{
DisableOnNumbers: true
})
```
</CodeGroup>
22 changes: 21 additions & 1 deletion snippets/samples/code_samples_update_filterable_attributes_1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,29 @@ client.index('movies').update_filterable_attributes([
```

```go Go
filterableAttributes := []string{
filterableAttributes := []interface{}{
"genres",
"director",
AttributeRule{
AttributePatterns: []string{"tag"}
Features: AttributeFeatures{
FacetSearch: false,
Filter: FilterFeatures{
Equality: true,
Comparison: false,
}
}
},
map[string]interface{}{
"attributePatterns": []interface{}{"year"}
"features": map[string]interface{}{
"facetSearch": false,
"filter": map[string]interface{}{
"equality": true,
"comparison": true,
}
}
}
}
client.Index("movies").UpdateFilterableAttributes(&filterableAttributes)
```
Expand Down
Loading