Skip to content

Commit 3cd5718

Browse files
smart cropping: address review feedback
1 parent 6fdb452 commit 3cd5718

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reference/api/search.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ Optionally, you can indicate a custom crop length for any attributes given to `a
460460

461461
Instead of supplying individual attributes, you can provide `["*"]` as a wildcard: `attributesToCrop=["*"]`. This causes `_formatted` to include the cropped values of all attributes present in [`attributesToRetrieve`](#attributes-to-retrieve).
462462

463-
#### Cropping rules
463+
#### Cropping algorithm
464464

465465
Suppose you have a field containing the following string: `Donatello is a skilled and smart turtle. Leonardo is the most skilled turtle. Raphael is the strongest turtle.`
466466

@@ -470,7 +470,7 @@ If a query contains only a single search term, Meilisearch crops around the firs
470470

471471
If a query contains multiple search terms, Meilisearch centers the crop around the largest number of unique matches, giving priority to terms that are closer to each other and follow the original query order. If you search for `skilled turtle` with a `cropLength` of 6, Meilisearch will return `Leonardo is the most skilled turtle`.
472472

473-
If Meilisearch does not find any query terms in a field, cropping begins at the first word in that field. If you search for `Michelangelo` with a `cropLength` of 4, Meilisearch will return `Donatello is a skilled …`.
473+
If Meilisearch does not find any query terms in a field, cropping begins at the first word in that field. If you search for `Michelangelo` with a `cropLength` of 4 and this string is present in another field, Meilisearch will return `Donatello is a skilled …`.
474474

475475
#### Example
476476

0 commit comments

Comments
 (0)