Today I learned how the indexer worked. I knew already, that while indexing in the backend you can decide which indexer not to run.
But what I didn’t know, it is the same on the CLI with dal:refresh:index.
If you look into the cli command help we can check the options:
19:18:15 ~/var/www/current $ bin/console dal:refresh:index --help Description: Refreshes the index for a given entity
Usage: dal:refresh:index [options]
Options: --use-queue Ignore cache and force generation --skip=SKIP Comma separated list of indexSo er names to be skipped --only=ONLY Comma separated list of indexer names to be generated -h, --help Display help for the given command. When no command is given display help for the list command -q, --quiet Do not output any message -V, --version Display this application version --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question -e, --env=ENV The Environment name. [default: "prod"] --no-debug Switch off debug mode. -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
We are interested in --only and --skip. What I wanted to do:
In the command implementation except that the indexer needs to be seperated by comma. For me, this was know, but hopefully you read the help text carefully.
And this is interesting and is as on the administration. We can filter with only and skip by indexer – unfortunately product.search-keyword is not an indexer in this sense. But a process? updater? Whatever we want to call it, we can only skip any but not limit it to one of the processes.
TL;DR – if you only want to reindex the search keywords, your cli command must look like this: