-
Notifications
You must be signed in to change notification settings - Fork 264
v0.28: Faceting settings #1761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
v0.28: Faceting settings #1761
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a5c2e63
faceting settings: API reference scaffolding
guimachiavelli 1beedf3
faceting settings: add new API reference page
guimachiavelli cfe49f5
faceting: add API reference to sidebar menu
guimachiavelli 0a8faa6
faceting: add newline at end of files
guimachiavelli 3ffacec
Apply suggestions from code review
guimachiavelli bb77d2d
Update reference/api/faceting.md
guimachiavelli 100c17a
faceting settings: address review feedback
guimachiavelli 456eec5
faceting settings: address review feedback
guimachiavelli 4c6a5f9
Apply suggestions from code review
guimachiavelli da8c4a6
faceting settings: add note to faceting guide
guimachiavelli c93be15
Update learn/advanced/filtering_and_faceted_search.md
guimachiavelli 3cf27c6
Merge branch 'v0.28' into v0.28-faceting-settings
maryamsulemani97 be6cd5c
v0.28: Add faceting to core concepts+index settings (#1767)
maryamsulemani97 8fa84da
Update reference/api/faceting.md
guimachiavelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Faceting | ||
|
||
_Child route of the [settings route](/reference/api/settings.md)._ | ||
|
||
This route allows you to configure the faceting settings for an index. | ||
|
||
Faceting settings can also be updated directly through the [global settings route](/reference/api/settings.md#update-settings) along with the other settings. | ||
|
||
To learn more about filtering and faceting, refer to our [dedicated guide](/learn/advanced/filtering_and_faceted_search.md). | ||
|
||
::: warning | ||
Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the `DELETE` routes. | ||
::: | ||
|
||
## Get faceting settings | ||
|
||
<RouteHighlighter method="GET" route="/indexes/{index_uid}/settings/faceting"/> | ||
|
||
Get the faceting settings of an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required. | ||
|
||
### Example | ||
|
||
<CodeSamples id="get_faceting_settings_1" /> | ||
|
||
#### Response: `200 OK` | ||
|
||
```json | ||
{ | ||
"maxValuesPerFacet": 100 | ||
} | ||
``` | ||
|
||
### Returned fields | ||
|
||
#### `maxValuesPerFacet` | ||
|
||
Maximum number of facet values returned for each facet. | ||
|
||
## Update faceting settings | ||
|
||
<RouteHighlighter method="PATCH" route="/indexes/{index_uid}/settings/faceting"/> | ||
|
||
Partially update the faceting settings for an index. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required. | ||
|
||
### Body | ||
|
||
#### `maxValuesPerFacet` | ||
|
||
**Type:** integer | ||
**Default value:** `100` | ||
|
||
Configure the maximum number of facet values returned for each facet. Values are sorted in ascending lexicographical order. | ||
|
||
For example, suppose a query's search results contain a total of three values for a `colors` facet: `blue`, `green`, and `red`. If you set `maxValuesPerFacet` to `2`, Meilisearch will only return `blue` and `green` in the response body's `facetDistribution` object. | ||
|
||
::: note | ||
Setting `maxValuesPerFacet` to a high value might negatively impact performance. | ||
::: | ||
|
||
#### Example | ||
|
||
<CodeSamples id="update_faceting_settings_1" /> | ||
|
||
#### Response: `202 Accepted` | ||
|
||
```json | ||
{ | ||
"taskUid": 1, | ||
"indexUid": "books", | ||
"status": "enqueued", | ||
"type": "settingsUpdate", | ||
"enqueuedAt": "2022-04-14T20:56:44.991039Z" | ||
} | ||
``` | ||
|
||
You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-task). | ||
|
||
## Reset faceting settings | ||
|
||
Reset an index's faceting settings to their default value. The index [`uid`](/learn/core_concepts/indexes.md#index-uid) is required. | ||
|
||
#### Example | ||
|
||
<CodeSamples id="reset_faceting_settings_1" /> | ||
|
||
#### Response: `200 OK` | ||
|
||
```json | ||
{ | ||
"taskUid": 1, | ||
"indexUid": "books", | ||
"status": "enqueued", | ||
"type": "settingsUpdate", | ||
"enqueuedAt": "2022-04-14T20:53:32.863107Z" | ||
} | ||
``` | ||
|
||
You can use the returned `taskUid` to get more details on [the status of the task](/reference/api/tasks.md#get-task). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.