2

What is the best way to do a reindex from the data?

I was thinking to create a cronjob every day at night and set the index mode to "manual update".

Now i'm not sure what is the best way to do this. Because i don't know what happens with product updates or the stock from a product. can someone help me please with info about it

Great, Lex

Lexperts
  • 353
  • 2
  • 7
  • 19

2 Answers2

1

Magento bundles shell scripts in shell/ folder and there you see indexer.php that allows you to schedule such tasks with cron over command line

Anton S
  • 12,750
  • 2
  • 35
  • 37
1

You don't need to set the index options to 'manual update' to run the indexer.php shell script. In fact, it's probably better not to; the 'update on save' option pretty much guarantees your data will be correct if someone modifies it during the day.

One of the only reasons you'd want 'manual update' is if you're running a product import to speed things up.

As Anton said, run a cron script to indexer.php to reindex all data at 3AM and things will be fine.

tonyhb
  • 3,706
  • 3
  • 20
  • 16
  • The strange thing is. When reindexing is in process some products disappearing. When it reindexen is done the products are back again. Is this a normal behavior? Thats why i think i have to set it to manual. – Lexperts Jul 02 '12 at 10:02
  • Yes, that's completely normal behaviour. You're recreating the list of which products are in which categories, so while this is happening the website won't show any products. Update on save shouldn't change the front of the website, though. – tonyhb Jul 02 '12 at 11:25
  • When i have the index all set to "Update on save" and i create a new product then this also happens. Is this also normal behavior? – Lexperts Jul 02 '12 at 11:31
  • That doesn't sound like normal behaviour, no. When you create a new product does the admin panel tell you to update your indexes? If so, which indexes are broken? – tonyhb Jul 02 '12 at 14:14
  • No, it auto updates itself. When i create a new product. Then the index "Product Prices" is in process. After a few seconds the process is ready and the products are visible again. – Lexperts Jul 02 '12 at 14:51