title: How to move 'out of stock' products to the end of the lists after search?
body: <p>I am a newbie in magento and I need your help.
  I need to move 'out of stock' products to the end of the lists in search results. How can I do this? </p>
  
  <p>I've found that module <code>catalogsearch</code> is used for searching. Also I've seen there is a table <code>cataloginventory_stock_item</code> and <code>is_in_stock</code> field. Is this a correct flag for checking product is out of stock or not. And I think I should add also an order condition when data is getting from DB. But I can not find where(a file) this data is getting form <code>catalogsearch_query</code> and <code>catalogsearch_result</code> tables and where (and how) should I add an order condition. Can you give me an example?</p>