Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen-G committed Jun 30, 2023
1 parent a46a0d5 commit 49f512d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/index-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ return [

Be aware that if you currently already have indices and would like to move to using aliases you will need to delete those indices before configuring the aliases.
In Elasticsearch a given name can only be either an index or alias, not both and this cannot be changed on-the-fly.

### Note on updating aliases
When you update a model, Laravel Scouts will update the index.
When you use index aliases, a new index is created and the alias is being pointed to the nex one.
What you don't want is for the alias to be pointing to the new index before Elasticsearch is done with indexing all documents.
To prevent this, the alias update is done in a job that is dispatched to the queue.
If there is no queue it will still be done in the background, but it will be done synchronously.
This could still be enough of a "delay" for Elasticsearch to finish indexing, so there is no immediate need to set up a queue.

0 comments on commit 49f512d

Please sign in to comment.