...
(Optional) Clean queue_message and magento_operation tables
Code Block DELETE FROM queue_message WHERE topic_name like "hawksearch.%"; DELETE FROM magento_operation where topic_name like "hawksearch.%";
Get the list of indexes via API (Postman)
Request:Code Block curl --location --request GET 'https://indexing-dev.hawksearch.net/api/v2/indexing/' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-HawkSearch-ApiKey: <API_KEY>' \ --data-raw ''
Result:
Code Block language json { "IndexNames": [ "magentoelastic.20220427.111354", "magentoelastic.20220426.153846" ] }
Get current index name (Postman)
Request:Code Block curl --location --request GET 'https://indexing-dev.hawksearch.net/api/v2/indexing/current' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-HawkSearch-ApiKey: <API_KEY>' \ --data-raw ''
Result:
Code Block { "IndexName": "magentoelastic.20220426.153846" }
Re-index via CLI command
bin/magento indexer:reindex hawksearch_productsentities
Review changes in indexes list via API (Postman). Make that non-current index
"magentoelastic.20220427.111354"
has been removed and a new one"magentoelastic.20220504.143505"
has been created
Request:Code Block curl --location --request GET 'https://indexing-dev.hawksearch.net/api/v2/indexing/' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-HawkSearch-ApiKey: <API_KEY>' \ --data-raw ''
Result:
Code Block language json { "IndexNames": [ "magentoelastic.20220504.143505", "magentoelastic.20220426.153846" ] }
Review changes in queue_message and magento_operation tables
Make sure Ensure that a bulk of new messages is created in the queue_message table and corresponding operations are created in the magento_operation table. The queue_message.body and magento_operation.serialized_data columns contain the newly created index name
"magentoelastic.20220504.143505"
in their text values.Process messages one by one. The number of messages handled at the same time can be controlled via
--max-messages
parameter.bin/magento queue:consumers:start --max-messages=1 hawksearch.indexing
After the last message is processed (message topic is hawksearch.indexing.fullreindex.finish) check via API (Postman) that the current index is changed to
magentoelastic.20220504.143505
Request:Code Block curl --location --request GET 'https://indexing-dev.hawksearch.net/api/v2/indexing/current' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-HawkSearch-ApiKey: <API_KEY>' \ --data-raw ''
Result:
Code Block { "IndexName": "magentoelastic.20220504.143505" }
...