Changeset 1970

Show
Ignore:
Timestamp:
07/15/07 10:59:04 (1 year ago)
Author:
benjamin
Message:

updated documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/REQUIRED_GEMS

    r1969 r1970  
    44Try to match the exact version number. To install a gem, simply run (e.g.): 
    55 
    6 sudo gem --include-dependencies --version 0.10.14 ferret 
     6sudo gem --include-dependencies --version 0.11.14 ferret 
    77 
    88----------- 
     
    1111  cached_model (1.3.1) 
    1212  capistrano (1.99.3) 
    13   ferret (0.10.14) 
     13  ferret (0.11.14) 
    1414  gruff (0.2.8) 
    15   memcache-client (1.3.0) 
    1615  rails (1.1.6) 
    1716  rcov (0.8.0.2) 
    1817  rmagick (1.15.4) 
    1918   
     19Applications required: 
     20  mysql 5.0 or higher 
     21  memcached (optional) 
     22   
  • trunk/lib/workers/ferret_server_worker.rb

    r1824 r1970  
    4242              @logger.info("opening writer") 
    4343              process_record( record, writer ) 
     44              # index until the queue is empty or we have indexed 
     45              # 256 records .. 
    4446              while not @queue.empty? and counter < 256 
    4547                record = @queue.pop 
     
    8688 
    8789 
    88       # haengt alle dependencies des durch args gegebenen Objekts an die queue an. 
    89       # damit der aufrufende Thread nicht zu lange geblockt wird, machen wir das 
    90       # ganze in einem eigenen Thread. 
    91       # TODO: fÃŒr extra Bonuspunkte die Queue double-ended machen und die records 
     90      # === Index dependencies 
     91      #  
     92      # after a record has been changed, a lot of other objects might  
     93      # need to be updated in the index as well. To get all depending objects, 
     94      # omdb has several dependency-views in the database.  
     95      # This method will assure, that not only the object itself gets updated 
     96      # in the index, but all dependent objects as well.  
     97      # Fetching all dependencies might take some time, so we create a new  
     98      # thread to fetch the dependencies and add them to the index queue 
     99      # 
     100      # :TODO: fÃŒr extra Bonuspunkte die Queue double-ended machen und die records 
    92101      # unpoppen so dass die Reihenfolge erhalten bleibt :) 
    93102      def index_dependencies(args) 
     
    144153      end 
    145154       
    146       #  
     155      # === Process queue entries 
     156      # 
     157      # Main method to process the entries of the indexing queue. Each element in the  
     158      # queue consit of a class_name, an id and a action. We know three actions 
     159      # for elements in the queue: 
     160      # - add     : Add the class_name/id AR-object to the index (or update the object) 
     161      # - remove  : Remove the class_name/id AR-object from the index 
     162      # - reindex : Run a complete reindex, this can be triggered via the  
     163      #             admin/search_controller action :reindex. 
    147164      def process_record( record, writer ) 
    148165        class_name, id, action = record 
     
    213230        online  = File.readlink(Indexer.online_index) 
    214231        offline = File.readlink(Indexer.offline_index) 
    215         File.delete Indexer.offline_index 
    216         File.delete Indexer.online_index 
     232        # File.delete Indexer.offline_index 
     233        # File.delete Indexer.online_index 
    217234        FileUtils.ln_s offline, Indexer.online_index, :force => true 
    218235        FileUtils.ln_s online,  Indexer.offline_index, :force => true 
     236        # Inform the mongrel servers that a new index exists. 
    219237        FileUtils.touch Indexer.index_status_file 
    220238      end