-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8402b12
commit b4b72e3
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,33 @@ | ||
--- | ||
title: Console commands | ||
--- | ||
# Console commands | ||
|
||
Scout provides two easy console commands for managing your indices. | ||
|
||
### Importing | ||
To import one or all indices you can run the following console command | ||
|
||
``` | ||
./craft scout/index/import <indexName?> | ||
``` | ||
|
||
The `indexName` argument is not required, all your mappings will be imported when you omit it. | ||
|
||
### Flushing/Clearing | ||
Clearing an index is as easy as running a command in your console. | ||
|
||
``` | ||
./craft scout/index/flush <indexName?> | ||
``` | ||
|
||
As with the import command, `indexName` is not required. | ||
|
||
When flushing, Scout will ask you to confirm that you really want to clear all the data in your index. You can bypass the confirmation by appending a `--force` flag. | ||
|
||
### Refreshing | ||
Does a flush/clear first and then imports the index again. | ||
|
||
``` | ||
./craft scout/index/refresh <indexName?> | ||
``` |
This file contains 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 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,29 @@ | ||
--- | ||
title: Replicas | ||
--- | ||
# Replicas | ||
|
||
Replicas can be created with the `replicas` function on `IndexSettings`. To configure replicas, include them in the `indices` array and set their `replicaIndex` to `true` so that they are not included in any syncing operations. | ||
|
||
Replica indices can have their configuration updated using the `./craft scout/settings/update` console command. | ||
|
||
```php | ||
<?php | ||
|
||
return [ | ||
'indices' => [ | ||
\rias\scout\ScoutIndex::create('Products') | ||
// ... | ||
->indexSettings( | ||
\rias\scout\IndexSettings::create() | ||
->minWordSizefor1Typo(4) | ||
->replicas(['virtual(Products_desc)']) | ||
) | ||
], | ||
[ | ||
\rias\scout\ScoutIndex::create('Products_desc') | ||
->replicaIndex(true) | ||
->indexSettings(IndexSettings::create()->customRanking(['desc(price)'])), | ||
], | ||
]; | ||
``` |
This file contains 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,17 @@ | ||
--- | ||
title: Events | ||
--- | ||
# Events | ||
|
||
[For long documents](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/indexing-long-documents/) it is advised to divide the element into multiple rows to keep each row within row data size. This can be done using `splitElementsOn()`. | ||
> Make sure to return an array in your transformer for these keys. | ||
```php | ||
->splitElementsOn([ | ||
'summary', | ||
'matrixFieldHandle' | ||
]) | ||
``` | ||
::: warning *Important* | ||
`distinctID` (available after indexing) must be set up as an attribute for faceting for deletion of objects to work when using splitElementsOn. | ||
::: |