Skip to content

Commit 89fa428

Browse files
committed
Rename the attributePosition rule into wordPosition
1 parent e680766 commit 89fa428

10 files changed

Lines changed: 29 additions & 29 deletions

File tree

.code-samples.meilisearch.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ update_settings_1: |-
162162
"proximity",
163163
"attributeRank",
164164
"sort",
165-
"attributePosition",
165+
"wordPosition",
166166
"exactness",
167167
"release_date:desc",
168168
"rank:desc"
@@ -271,7 +271,7 @@ update_ranking_rules_1: |-
271271
"proximity",
272272
"attributeRank",
273273
"sort",
274-
"attributePosition",
274+
"wordPosition",
275275
"exactness",
276276
"release_date:asc",
277277
"rank:desc"
@@ -1063,7 +1063,7 @@ sorting_guide_update_ranking_rules_1: |-
10631063
"typo",
10641064
"proximity",
10651065
"attributeRank",
1066-
"attributePosition",
1066+
"wordPosition",
10671067
"exactness"
10681068
]'
10691069
sorting_guide_sort_nested_1: |-

guides/relevancy/interpreting_ranking_scores.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Let's see how moving Sort **one position** in your ranking rules changes which r
9696
We’ve set up our ranking rules to have sort after our Group 1 wide net rules.
9797

9898
```json
99-
["words", "typo", "proximity", "sort", "attributeRank", "attributePosition", "exactness"]
99+
["words", "typo", "proximity", "sort", "attributeRank", "wordPosition", "exactness"]
100100
```
101101

102102
With this set up Meilisearch evaluates the text relevance rules first, *then* uses Sort.
@@ -196,7 +196,7 @@ Also notice: Sort shows a `value` instead of a `score`. That's because Sort does
196196
Now let's move `sort` to the top of our ranking rules:
197197

198198
```json
199-
["sort", "words", "typo", "proximity", "attributeRank", "attributePosition", "exactness"]
199+
["sort", "words", "typo", "proximity", "attributeRank", "wordPosition", "exactness"]
200200
```
201201

202202
### 🥇 Result #1 — Chicken Stew with Curry Spices and Vegetables

guides/relevancy/ordering_ranking_rules.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Ranking rules:
7878
"proximity",
7979
"attributeRank",
8080
"sort", // "price:asc" "author:desc" gets swapped in here
81-
"attributePosition",
81+
"wordPosition",
8282
"exactness",
8383
"release_date:asc",
8484
"movie_ranking:desc"
@@ -116,7 +116,7 @@ Place custom ranking rules at the end of your sequence. They work best for addin
116116
Each ranking rule has its own settings you can fine-tune beyond just ordering. For example, you can adjust which fields take priority in attribute ranking, or configure how aggressively typo tolerance matches similar words. If you want to dig into the specifics:
117117

118118
- [Built-in ranking rules](https://www.meilisearch.com/docs/learn/relevancy/ranking_rules#list-of-built-in-ranking-rules) — how each rule works and what it evaluates
119-
- [Attribute ranking order](https://www.meilisearch.com/docs/learn/relevancy/attribute_ranking_order) — controlling which fields matter most with `attributeRank` and `attributePosition`
119+
- [Attribute ranking order](https://www.meilisearch.com/docs/learn/relevancy/attribute_ranking_order) — controlling which fields matter most with `attributeRank` and `wordPosition`
120120
- [Typo tolerance settings](https://www.meilisearch.com/docs/learn/relevancy/typo_tolerance_settings) — adjusting how flexible matching behaves
121121

122122
**Want to see these rules in action?** In our next guide, [How Do I Interpret Ranking Score Details?](/guides/relevancy/interpreting_ranking_scores), we walk through a real example showing exactly how Meilisearch evaluates each rule — and how moving Sort one position can flip your results.

learn/filtering_and_sorting/sort_search_results.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This is the default configuration of Meilisearch's ranking rules:
8585
"proximity",
8686
"attributeRank",
8787
"sort",
88-
"attributePosition",
88+
"wordPosition",
8989
"exactness"
9090
]
9191
```

learn/relevancy/attribute_ranking_order.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ By default, nested fields share the same weight as their parent attribute. Use d
3838
With the above ranking order, `review.critic` becomes more important than its sibling `review.user` when calculating a document's ranking score.
3939

4040
<Note>
41-
The `attributeRank` and `attributePosition` rules' positions in [`rankingRules`](/learn/relevancy/ranking_rules) determine how the results are sorted. Meaning, **if `attributeRank` is at the bottom of the ranking rules list, it will have almost no impact on your search results.**
41+
The `attributeRank` and `wordPosition` rules' positions in [`rankingRules`](/learn/relevancy/ranking_rules) determine how the results are sorted. Meaning, **if `attributeRank` is at the bottom of the ranking rules list, it will have almost no impact on your search results.**
4242

43-
The legacy `attribute` rule combines both `attributeRank` and `attributePosition`. If you use `attribute`, its position determines the impact of both attribute ranking order and position within attributes.
43+
The legacy `attribute` rule combines both `attributeRank` and `wordPosition`. If you use `attribute`, its position determines the impact of both attribute ranking order and position within attributes.
4444
</Note>

learn/relevancy/custom_ranking_rules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The following array includes all built-in ranking rules and places the custom ru
5353
"proximity",
5454
"attributeRank",
5555
"sort",
56-
"attributePosition",
56+
"wordPosition",
5757
"exactness",
5858
"release_date:asc",
5959
"movie_ranking:desc"

learn/relevancy/ranking_rules.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Meilisearch contains seven built-in ranking rules in the following order:
1919
"proximity",
2020
"attributeRank",
2121
"sort",
22-
"attributePosition",
22+
"wordPosition",
2323
"exactness"
2424
]
2525
```
@@ -62,13 +62,13 @@ This rule evaluates only the position of matched words within attributes and doe
6262

6363
## Attribute
6464

65-
`attribute` is an older built-in ranking rule equivalent to using both `attributeRank` and `attributePosition` together. When you use `attribute`, Meilisearch first sorts results by the attribute ranking order, then uses the position within attributes as a tiebreaker.
65+
`attribute` is an older built-in ranking rule equivalent to using both `attributeRank` and `wordPosition` together. When you use `attribute`, Meilisearch first sorts results by the attribute ranking order, then uses the position within attributes as a tiebreaker.
6666

6767
<Warning>
68-
You cannot use `attribute` together with `attributeRank` or `attributePosition`. If you try to configure ranking rules with both, Meilisearch will return an error. We recommend using a combination of the `attributeRank` and `attributePosition` rules.
68+
You cannot use `attribute` together with `attributeRank` or `wordPosition`. If you try to configure ranking rules with both, Meilisearch will return an error. We recommend using a combination of the `attributeRank` and `wordPosition` rules.
6969
</Warning>
7070

71-
For most use-cases, we recommend using `attributeRank` and `attributePosition` separately. This gives you more control over result ordering by allowing you to place other ranking rules (like `sort` or custom ranking rules) between them.
71+
For most use-cases, we recommend using `attributeRank` and `wordPosition` separately. This gives you more control over result ordering by allowing you to place other ranking rules (like `sort` or custom ranking rules) between them.
7272

7373
## 6. Sort
7474

learn/relevancy/ranking_score.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: This article explains how the order of attributes in the `searchabl
66

77
When using the [`showRankingScore` search parameter](/reference/api/search#ranking-score), Meilisearch adds a global ranking score field, `_rankingScore`, to each document. The `_rankingScore` is between `0.0` and `1.0`. The higher the ranking score, the more relevant the document.
88

9-
Ranking rules sort documents either by relevancy (`words`, `typo`, `proximity`, `exactness`, `attributeRank`, `attributePosition`) or by the value of a field (`sort`). Since `sort` doesn't rank documents by relevancy, it does not influence the `_rankingScore`.
9+
Ranking rules sort documents either by relevancy (`words`, `typo`, `proximity`, `exactness`, `attributeRank`, `wordPosition`) or by the value of a field (`sort`). Since `sort` doesn't rank documents by relevancy, it does not influence the `_rankingScore`.
1010

1111
<Note>
1212
A document's ranking score does not change based on the scores of other documents in the same index.
@@ -19,7 +19,7 @@ The table below details all the index settings that can influence the `_rankingS
1919
| Index setting | Influences if | Rationale |
2020
| :--------------------- | :--------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2121
| `searchableAttributes` | The `attributeRank` ranking rule is used | The `attributeRank` ranking rule rates the document depending on the attribute in which the query terms show up. The order is determined by `searchableAttributes` |
22-
| `searchableAttributes` | The `attributePosition` ranking rule is used | The `attributePosition` ranking rule rates the document based on the position of query terms within attributes |
22+
| `searchableAttributes` | The `wordPosition` ranking rule is used | The `wordPosition` ranking rule rates the document based on the position of query terms within attributes |
2323
| `rankingRules` | Always | The score is computed by computing the subscore of each ranking rule with a weight that depends on their order |
2424
| `stopWords` | Always | Stop words influence the `words` ranking rule, which is almost always used |
2525
| `synonyms` | Always | Synonyms influence the `words` ranking rule, which is almost always used |

learn/resources/telemetry.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ This list is liable to change with every new version of Meilisearch. It's not be
167167
| `ranking_rules.typo_position` | Position of the `typo` ranking rule if any, otherwise `null` | 2
168168
| `ranking_rules.proximity_position` | Position of the `proximity` ranking rule if any, otherwise `null` | 3
169169
| `ranking_rules.attribute_position` | Position of the `attribute` ranking rule if any, otherwise `null` | 4
170-
| `ranking_rules.attribute_rank_position` | Position of the `attributeRank` ranking rule if any, otherwise `null` | 4
171-
| `ranking_rules.attribute_position_position` | Position of the `attributePosition` ranking rule if any, otherwise `null` | 6
172-
| `ranking_rules.sort_position` | Position of the `sort` ranking rule | 5
173-
| `ranking_rules.exactness_position` | Position of the `exactness` ranking rule if any, otherwise `null` | 6
174-
| `ranking_rules.values` | A string representing the ranking rules without the custom asc-desc rules | "words, typo, attribute, sort, exactness"
170+
| `ranking_rules.attribute_rank_position` | Position of the `attributeRank` ranking rule if any, otherwise `null` | 5
171+
| `ranking_rules.attribute_position_position` | Position of the `wordPosition` ranking rule if any, otherwise `null` | 6
172+
| `ranking_rules.sort_position` | Position of the `sort` ranking rule | 7
173+
| `ranking_rules.exactness_position` | Position of the `exactness` ranking rule if any, otherwise `null` | 8
174+
| `ranking_rules.values` | A string representing the ranking rules without the custom asc-desc rules | "words, typo, attributeRank, sort, wordPosition, exactness"
175175
| `sortable_attributes.total` | Number of sortable attributes | 3
176176
| `sortable_attributes.has_geo` | `true` if `_geo` is set as a sortable attribute | true
177177
| `filterable_attributes.total` | Number of filterable attributes | 3

reference/api/settings.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ By default, the settings object looks like this. All fields are modifiable.
102102
"proximity",
103103
"attributeRank",
104104
"sort",
105-
"attributePosition",
105+
"wordPosition",
106106
"exactness"
107107
],
108108
"stopWords": [],
@@ -239,7 +239,7 @@ If the provided index does not exist, it will be created.
239239
| **[`proximityPrecision`](#proximity-precision)** | String | `"byWord"` | Precision level when calculating the proximity ranking rule |
240240
| **[`facetSearch`](#facet-search)** | Boolean | `true` | Enable or disable [facet search](/reference/api/facet_search) functionality |
241241
| **[`prefixSearch`](#prefix-search)** | String | `"indexingTime"` | When Meilisearch should return results only matching the beginning of query |
242-
| **[`rankingRules`](#ranking-rules)** | Array of strings | `["words",`<br />`"typo",`<br />`"proximity",`<br />`"attributeRank",`<br />`"sort",`<br />`"attributePosition",`<br />`"exactness"]` | List of ranking rules in order of importance |
242+
| **[`rankingRules`](#ranking-rules)** | Array of strings | `["words",`<br />`"typo",`<br />`"proximity",`<br />`"attributeRank",`<br />`"sort",`<br />`"wordPosition",`<br />`"exactness"]` | List of ranking rules in order of importance |
243243
| **[`searchableAttributes`](#searchable-attributes)** | Array of strings | All attributes: `["*"]` | Fields in which to search for matching query words sorted by order of importance |
244244
| **[`searchCutoffMs`](#search-cutoff)** | Integer | `null`, or 1500ms | Maximum duration of a search query |
245245
| **[`separatorTokens`](#separator-tokens)** | Array of strings | Empty | List of characters delimiting where one term begins and ends |
@@ -1474,8 +1474,8 @@ Ranking rules are built-in rules that rank search results according to certain c
14741474
| **`"typo"`** | Sorts results by increasing number of typos |
14751475
| **`"proximity"`** | Sorts results by increasing distance between matched query terms |
14761476
| **`"attributeRank"`** | Sorts results by the attribute rank of the query terms within attributes |
1477-
| **`"attributePosition"`**| Sorts results by the position of query terms within attributes |
1478-
| **`"attribute"`** | Legacy rule combining `attributeRank` and `attributePosition` |
1477+
| **`"wordPosition"`**| Sorts results by the position of query terms within attributes |
1478+
| **`"attribute"`** | Legacy rule combining `attributeRank` and `wordPosition` |
14791479
| **`"sort"`** | Sorts results based on parameters decided at query time |
14801480
| **`"exactness"`** | Sorts results based on the similarity of the matched words with the query words |
14811481

@@ -1488,7 +1488,7 @@ Ranking rules are built-in rules that rank search results according to certain c
14881488
"proximity",
14891489
"attributeRank",
14901490
"sort",
1491-
"attributePosition",
1491+
"wordPosition",
14921492
"exactness"
14931493
]
14941494
```
@@ -1518,7 +1518,7 @@ Get the ranking rules of an index.
15181518
"proximity",
15191519
"attributeRank",
15201520
"sort",
1521-
"attributePosition",
1521+
"wordPosition",
15221522
"exactness",
15231523
"release_date:desc"
15241524
]
@@ -1554,7 +1554,7 @@ If some documents do not contain the attribute defined in a custom ranking rule,
15541554

15551555
Make sure that any attribute used in a custom ranking rule is present in all of your documents. For example, if you set the custom ranking rule `desc(year)`, make sure that all your documents contain the attribute `year`.
15561556

1557-
You cannot use the `attribute` ranking rule together with `attributeRank` or `attributePosition`. If you try to configure ranking rules with both, Meilisearch will return an error. We recommend using a combination of the `attributeRank` and `attributePosition` rules.
1557+
You cannot use the `attribute` ranking rule together with `attributeRank` or `wordPosition`. If you try to configure ranking rules with both, Meilisearch will return an error. We recommend using a combination of the `attributeRank` and `wordPosition` rules.
15581558
</Warning>
15591559

15601560
[To learn more about ranking rules, refer to our dedicated guide.](/learn/relevancy/ranking_rules)

0 commit comments

Comments
 (0)