How to search for complete SKU like "K-00019" (without splitting it at "-" and without removing leading zeros) I am using Search API to search commerce products by SKU. But when I enter "K-00019" as search string, every item is retrieved that contains "19". I investigated why this happens and found, that a method called "prepareKeys" splits the string K-00019 into two parts: K and 00019, then ignores the first part (letter K) and transforms the second part to 19 because of leading zeroes.
As you can mention, this behaviour leads to way too much results.
I need a search that allows to search for the complete sku. Do you have an idea how I can accomplish this? I do not have to necessary use Search API, if you have another suggestion, it would be perfectly fine, even a workaround would be okay.
I made a workaround: I added a computed field to the product type , copying the SKU, removing the dash/hyphen and saving this value. Instead of including the real SKU in the index, I included this stripped version.
At the form part, I added a validation function that removes dashes/hypens from the search input automatically. Just for sake of documentation:

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'views_exposed_form') {
    $form['#validate'][] = 'sku_search_validate';
  }

function sku_search_validate($form, &amp;$form_state) {
  if (isset($form_state['values']['my_sku']) &amp;&amp; !empty($form_state['values']['my_sku'])) {
    $new_value = str_replace('-', '', $form_state['values']['my_sku']);
    $form['my_sku']['#parents'] = array('my_sku');
    form_set_value($form['my_sku'], $new_value, $form_state);
  }
}