title: How to filter search results in this example
body: <p>I have a product table that contains thousands of products. Some products are available in different colors. But when somebody searches for example 'mp3 player' i dont want to show him every color, instead just the player with the best selling color.</p>
  
  <p>Her is the table layout (simplified):</p>
  
  <pre><code>ID | PRODUCT_NAME      | COLOR | SALE_COUNT
  ===========================================
   1 | Mp3 player red    | red   | 2
   2 | Mp3 player gold   | gold  | 1
   3 | Mp3 player black  | black | 100
  </code></pre>
  
  <p>But, when a user searches for 'Mp3 player red' i want to show him the red player, instead of the black one. The search is performed using the 'like' operator (yeah, i know lucene, anyway i need to solve this).</p>
  
  <p>Any suggestions how to solve this issue? i have a few ideas but none of them seems to be a good solution.
  thanks,</p>
  
  <p>postgreSQL db and jave is used to create the result.</p>