title: adding a multiple list attribute to product collection filter in magento
body: <p>I am trying to do an ajax related magento search, and i can't manage to correctly add a multi-select type product attribute to a product collection,
  for instance:</p>
  
  <pre><code>$productModel = Mage::getModel('catalog/product'); //getting product model
  $productCollection = $productModel-&gt;getCollection();
  $productCollection-&gt;addAttributeToSelect(
                          Mage::getSingleton('catalog/config')
                              -&gt;getProductAttributes()
                      );
  $productCollection-&gt;addAttributeToFilter(
               array(
                    array('attribute'=&gt;'my_attribute_id', 
                            'finset' =&gt; Mage::getResourceModel('catalog/product')
                                          -&gt;getAttribute('my_attribute_id')          
                                          -&gt;getSource()
                                         -&gt;getOptionId($searched))
                      );
  </code></pre>
  
  <p>where $searched is the string in which i save the keyword. Now, let's presume that my_attribute_id is a multi-select product attribute which has one option named as "Red Bull"...if i search after the exact string "red bull", it works, but i would like to work if i search only after "red" or "bull".
  Is there a way to get the option id for an attribute, even if the search string is incomplete? Because the problem is here:</p>
  
  <pre><code> Mage::getResourceModel('catalog/product')
                          -&gt;getAttribute('my_attribute_id')
                          -&gt;getSource()
                          -&gt;getOptionId($searched))
  </code></pre>
  
  <p>this code returns the id of the attribute option only if i search it entirely.Probably the model does a query something like this </p>
  
  <pre><code>"select...where value='$searched'"
  </code></pre>
  
  <p>Is there a way to get a list of attribute option id's even if the value of the option is not complete?..so to do a query like this </p>
  
  <pre><code>"select...where value like '%$searched%'"
  </code></pre>
  
  <p>Or is there a better way to retrieve product collection after a multi-select attribute partial value, other then the solution that I am trying?
  Many thanks!</p>