fullSearchSync.sh 888 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. Cur_Dir=$(cd `dirname $0`; pwd)
  3. # init full search collection indexes.
  4. $Cur_Dir/../../../../../yii product/search/initindex
  5. # get now update timestamp.
  6. nowtime=`$Cur_Dir/../../../../../yii product/search/nowtime`
  7. ###### 1.Sync Section : Sync Product Serach Collection
  8. # get product all count.
  9. count=`$Cur_Dir/../../../../../yii product/search/synccount`
  10. pagenum=`$Cur_Dir/../../../../../yii product/search/syncpagenum`
  11. echo "There are $count products to process"
  12. echo "There are $pagenum pages to process"
  13. echo "##############ALL BEGINING###############";
  14. for (( i=1; i<=$pagenum; i++ ))
  15. do
  16. $Cur_Dir/../../../../../yii product/search/syncdata $i
  17. echo "Page $i done"
  18. done
  19. # ()delete all search data that sync_updated_at $gt $nowtime.
  20. $Cur_Dir/../../../../../yii product/search/deletenotactiveproduct $nowtime
  21. echo "##############ALL COMPLETE###############";