> For the complete documentation index, see [llms.txt](https://docs.codegiganten.de/plugin-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/commands.md).

# Commands

The console command of the plugin with all options and the Shopware commands that help with installation, operation and troubleshooting.

This page is meant for administrators and agencies. It describes the console command of the plugin and the Shopware commands you need in connection with the search. You run all commands in the main folder of your shop.

The Shopware commands are Shopware standard, their options are not part of the plugin. If in doubt, `bin/console <command> --help` shows the options of your Shopware version.

## The plugin's command: backfill revenue

The plugin brings exactly one command of its own:

```bash
bin/console cogi-insightsearch:suite-backfill
```

### What it is for

The command backfills orders and revenue via the search **once as daily totals** for the cogi Commander. This makes sense for orders from the time before the Commander was installed. You can read more about the Commander under [Feedback, support and Commander](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/feedback-and-commander.md).

### Prerequisite

The cogi Commander must be installed and active. Otherwise the command stops and reports that the Commander is not active. The right order is:

1. Install and activate the Commander.
2. Start the backfill.
3. After that, the Commander takes over the further data itself.

### Options

| Option              | Effect                                              | Default    |
| ------------------- | --------------------------------------------------- | ---------- |
| `--from=YYYY-MM-DD` | First day from which orders are backfilled          | all orders |
| `--force`           | Runs the backfill again although it has already run | off        |

Examples:

```bash
# backfill all orders
bin/console cogi-insightsearch:suite-backfill

# only orders from 1 January 2026
bin/console cogi-insightsearch:suite-backfill --from=2026-01-01

# run again
bin/console cogi-insightsearch:suite-backfill --force
```

### Good to know

* If the backfill runs a second time without `--force`, the command reports on which date it already ran and does nothing.
* Use `--force` only as long as the Commander has not taken over anything yet. Otherwise values are counted twice.
* The date for `--from` must be in the format `YYYY-MM-DD`, for example `2026-01-01`. Otherwise the command stops with an error message.
* The period ends on the day on which the running route via events began. This way nothing is counted twice.
* At the end the command reports how many orders it read, how many rows it wrote and which period it covers.

## Shopware commands in this context

### Installation and update

| Command                                                   | Effect                                                              |
| --------------------------------------------------------- | ------------------------------------------------------------------- |
| `bin/console plugin:refresh`                              | Lets Shopware detect the plugin after the files have been placed    |
| `bin/console plugin:install --activate CogiInsightSearch` | Installs and activates the plugin                                   |
| `bin/console plugin:update CogiInsightSearch`             | Updates the plugin and runs database adjustments                    |
| `bin/console cache:clear`                                 | Clears the Shopware cache                                           |
| `bin/console theme:compile`                               | Rebuilds the theme so that changes in the storefront become visible |

If you install the plugin through the extension manager in the admin, the first three commands are not needed.

The commands for installation and update in order:

```bash
bin/console plugin:refresh
bin/console plugin:install --activate CogiInsightSearch
bin/console cache:clear
```

```bash
bin/console plugin:update CogiInsightSearch
bin/console cache:clear
```

### Background processing (worker)

| Command                                            | Effect                                                                                                                |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `bin/console messenger:consume async low_priority` | Starts a worker. It works through the jobs of the queue, for example push packages and messages about cart and order. |
| `bin/console messenger:stop-workers`               | Tells running workers to end. A service such as Supervisor or systemd restarts them.                                  |

For permanent operation, start the worker as a service and give it limits:

```bash
bin/console messenger:consume async low_priority --time-limit=3600 --memory-limit=512M
```

When which command is worth it:

* **After a plugin update:** `messenger:stop-workers`, so that the workers load the new code.
* **Push is stuck or statistics stay empty:** Check whether a worker is running. More on this under [Push and live synchronisation](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/push-and-live-sync.md).

### Scheduled tasks

| Command                                        | Effect                                                                  |
| ---------------------------------------------- | ----------------------------------------------------------------------- |
| `bin/console scheduled-task:register`          | Registers the scheduled tasks, including those of the plugin            |
| `bin/console scheduled-task:run`               | Works through the scheduled tasks permanently (as a service or by cron) |
| `bin/console scheduled-task:run-single <task>` | Starts a single task immediately                                        |

The tasks of the plugin are named:

| Technical name                      | Effect                                   |
| ----------------------------------- | ---------------------------------------- |
| `cogi_insightsearch.push_indexing`  | Daily push of all push indexes           |
| `cogi_insightsearch.push_finalize`  | Monitoring of stuck runs                 |
| `cogi_insightsearch.keepalive`      | Connection check                         |
| `cogi_insightsearch.delta_push`     | Live synchronisation                     |
| `cogi_insightsearch.order_backfill` | Catching up on orders of the last 7 days |

Example: you have the monitoring check a stuck push run immediately, without waiting 10 minutes:

```bash
bin/console scheduled-task:run-single cogi_insightsearch.push_finalize
```

You find an overview of the tasks with their interval under [Push and live synchronisation](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/push-and-live-sync.md).

### Reading and setting configuration

| Command                                                                | Effect                                                       |
| ---------------------------------------------------------------------- | ------------------------------------------------------------ |
| `bin/console system:config:get CogiInsightSearch.config.enableSearch`  | Reads a configuration value, here the switch "Enable search" |
| `bin/console system:config:set CogiInsightSearch.config.<key> <value>` | Sets a configuration value                                   |

An important case is the **copy of a shop to staging**. If an already connected shop was copied 1:1, the copy carries the same connection as the original and would write into its search index and statistics. In that case, empty both keys in the copy:

```bash
bin/console system:config:set CogiInsightSearch.config.installationSecret ""
bin/console system:config:set CogiInsightSearch.config.accountSecret ""
```

Then run through the setup in the plugin again and create an index of its own. Do not deactivate or uninstall the plugin in the copy beforehand, otherwise the original is logged out. More on this under [Stage and Live](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/stage-and-live.md).

### Indexes and product export

| Command                               | Effect                                                                                |
| ------------------------------------- | ------------------------------------------------------------------------------------- |
| `bin/console dal:refresh:index`       | Rebuilds the Shopware indexes, for example after large imports                        |
| `bin/console product-export:generate` | Generates the product export file (the feed) immediately. `--help` shows the options. |

Two notes on this:

* **Pull feed:** With the setting "Generate in the background", changes only appear when Shopware regenerates the export. You can trigger the export with `product-export:generate`. Afterwards, re-import the product data in the "Sources" area.
* **Live synchronisation:** The plugin notes changes that Shopware reports when rebuilding the indexes. A very large rebuild can queue many entries. If they exceed 20,000, the queue is discarded and the next complete push takes over everything.

## Which command helps when?

| Situation                             | Command                                                                        |
| ------------------------------------- | ------------------------------------------------------------------------------ |
| Plugin newly installed or updated     | `plugin:install --activate` or `plugin:update`, then `cache:clear`             |
| Worker with old code                  | `messenger:stop-workers`                                                       |
| Storefront settings have no effect    | `cache:clear`, for theme changes `theme:compile`                               |
| Push stops                            | Check the worker, `scheduled-task:run-single cogi_insightsearch.push_finalize` |
| Feed shows old data                   | `product-export:generate`, then "Re-import product data"                       |
| Staging copy writes into the original | Empty both keys with `system:config:set`                                       |
| Old orders missing in the Commander   | `cogi-insightsearch:suite-backfill`                                            |

## Further reading

{% content-ref url="/pages/kG1p17yKCiPZb4o3gw2S" %}
[Push and live synchronisation](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/push-and-live-sync.md)
{% endcontent-ref %}

{% content-ref url="/pages/cPKiMg6nNvV0NE0owXnG" %}
[Troubleshooting](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/troubleshooting.md)
{% endcontent-ref %}

{% content-ref url="/pages/kRomH0o5aBX5iDGMqpD3" %}
[Stage and live](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/stage-and-live.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
