|
2 | 2 |
|
3 | 3 | By default, whenever a document is added to Meilisearch, all new attributes found in it are automatically added to two lists:
|
4 | 4 |
|
5 |
| -- [`searchableAttributes`](/learn/configuration/displayed_searchable_attributes.md#the-searchableattributes-list): Attributes whose values are searched for matching query words |
6 | 5 | - [`displayedAttributes`](/learn/configuration/displayed_searchable_attributes.md#displayed-fields): Attributes whose fields are displayed in documents
|
| 6 | +- [`searchableAttributes`](/learn/configuration/displayed_searchable_attributes.md#the-searchableattributes-list): Attributes whose values are searched for matching query words |
| 7 | + |
| 8 | +By default, every field in a document is **displayed** and **searchable**. These properties can be modified in the [settings](/reference/api/settings.md). |
| 9 | + |
| 10 | +## Displayed fields |
| 11 | + |
| 12 | +The fields whose attributes are added to the [`displayedAttributes` list](/reference/api/settings.md#displayed-attributes) are **displayed in each matching document**. |
| 13 | + |
| 14 | +Documents returned upon search contain only displayed fields. If a field attribute is not in the displayed-attribute list, the field won't be added to the returned documents. |
7 | 15 |
|
8 |
| -This means that by default, every field in a document is **searchable** and **displayed**. These properties can be modified in the [settings](/reference/api/settings.md). |
| 16 | +**By default, all field attributes are set as displayed**. |
| 17 | + |
| 18 | +#### Example |
| 19 | + |
| 20 | +Suppose you manage a database that contains information about movies. By adding the following settings, documents returned upon search will contain the fields `title`, `overview`, `release_date` and `genres`. |
| 21 | + |
| 22 | +<CodeSamples id="field_properties_guide_displayed_1" /> |
9 | 23 |
|
10 | 24 | ## Searchable fields
|
11 | 25 |
|
@@ -54,24 +68,6 @@ Suppose that you manage a database of movies with the following fields: `id`, `o
|
54 | 68 |
|
55 | 69 | <CodeSamples id="field_properties_guide_searchable_1" />
|
56 | 70 |
|
57 |
| -## Displayed fields |
58 |
| - |
59 |
| -The fields whose attributes are added to the [`displayedAttributes` list](/reference/api/settings.md#displayed-attributes) are **displayed in each matching document**. |
60 |
| - |
61 |
| -Documents returned upon search contain only displayed fields. |
62 |
| - |
63 |
| -**By default, all field attributes are set as displayed**. |
64 |
| - |
65 |
| -Therefore, if a field attribute is not in the displayed-attribute list, the field won't be added to the returned documents. |
66 |
| - |
67 |
| -This list can be restricted to a selected set of attributes in the settings. |
68 |
| - |
69 |
| -#### Example |
70 |
| - |
71 |
| -Suppose you manage a database that contains information about movies. By adding the following settings, documents returned upon search will contain the fields `title`, `overview`, `release_date` and `genres`. |
72 |
| - |
73 |
| -<CodeSamples id="field_properties_guide_displayed_1" /> |
74 |
| - |
75 | 71 | ## Data storing
|
76 | 72 |
|
77 | 73 | All fields are stored in the database. **This behavior cannot be changed**.
|
|
0 commit comments