Follow

Command line tool - CLI

With version 1.4.9.2 we released impoved version of command line tool to perform operations from command line (CLI)

 

 $ php shell/lucene-tool.php

 Usage:  php -f lucene-tool.php [options]
   --remove_not_existing <storeId>          Removes not existing products from index
   --reset_search_results                   Clears magento search results
   --optimize_index <storeId>               Optimizes Lucene index
   --mark_unprocessed <storeId>             Marks all products for given store as unprocessed
   --count_processed <storeId>              Returns number of products marked as processed
   --count_indexed <storeId>                Returns number of non-deleted documents in index
   --remove_from_index                          <productId>        Removes one product from all indexes (identified by productId)
   --removeall <storeId>        Removes all documents from index
   help                                     This help


   <storeId> is valid store Id f.e. 1
   <productId> is valid product Id (entity_id) f.e. 1234

  Please be extra careful with this as you can break your search if you remove all products!


 --remove_not_existing <storeId>

 This command will find all products which don't exist in magento but still exist in Lucene index and remove them from the index

StoreId is the Id of magento storeview

--reset_search_results 

This command will mark all magento queries as unprocessed - this will make sure that search results are refreshed

--optimize_index <storeId>

This command will optimize Lucene index for given store view

StoreId is the Id of magento storeview

--mark_unprocessed <storeId>            

Marks all products for given store as unprocessed. After doing this operation - next time you run indexer all products from given store view will be reindexed

StoreId is the Id of magento storeview

   --count_processed <storeId>             

Returns number of products marked as processed in database. All products marked as processed will not be indexed again - until you save product.

StoreId is the Id of magento storeview

   --count_indexed <storeId>               

Returns number of non-deleted documents in Lucene index. This should be number of active ,in stock and marked as searchable products in magento catalogue.

StoreId is the Id of magento storeview

   --remove_from_index  <productId>

Removes product from Lucene index - not from magento! Once product is removed and search cache refreshed - product will not appear in search results

productId is Catalog Product entity Id 


 Always have a copy of your database and var/indexer folder

0 Comments

Article is closed for comments.
Powered by Zendesk