diff --git a/modules/search_api_db/service2.inc b/modules/search_api_db/service.inc
index a66ca4f..9f57679 100644
--- a/modules/search_api_db/service2.inc
+++ b/modules/search_api_db/service.inc
@@ -378,6 +378,7 @@ class SearchApiDbService extends SearchApiAbstractService {
         $type = $field['type'];
         $value = $this->convert($field['value'], $type, $field['original_type'], $index);
 
+        
         if (search_api_is_text_type($type, array('text', 'tokens'))) {
           $words = array();
           foreach ($value as $token) {
@@ -753,15 +754,15 @@ class SearchApiDbService extends SearchApiAbstractService {
   /**
    * Helper method for removing unnecessary nested expressions from keys.
    */
-  protected function prepareKeys($keys) {
+  protected function prepareKeys($keys, $split = TRUE) {
     if (is_scalar($keys)) {
-      $keys = $this->splitKeys($keys);
+      $keys = $this->splitKeys($keys, $split);
       return is_array($keys) ? $this->eliminateDuplicates($keys) : $keys;
     }
     elseif (!$keys) {
       return NULL;
     }
-    $keys = $this->eliminateDuplicates($this->splitKeys($keys));
+    $keys = $this->eliminateDuplicates($this->splitKeys($keys, $split));
     $conj = $keys['#conjunction'];
     $neg = !empty($keys['#negation']);
     foreach ($keys as $i => &$nested) {
@@ -794,7 +795,7 @@ class SearchApiDbService extends SearchApiAbstractService {
   /**
    * Helper method for splitting keys.
    */
-  protected function splitKeys($keys) {
+  protected function splitKeys($keys, $split = TRUE) {
     if (is_scalar($keys)) {
       $proc = drupal_strtolower(trim($keys));
       if (is_numeric($proc)) {
@@ -804,16 +805,22 @@ class SearchApiDbService extends SearchApiAbstractService {
         $this->ignored[$keys] = 1;
         return NULL;
       }
+      if(!$split) {
+        return $proc;
+      }
       $words = preg_split('/[^\p{L}\p{N}]+/u', $proc, -1, PREG_SPLIT_NO_EMPTY);
       if (count($words) > 1) {
-        $proc = $this->splitKeys($words);
+        $proc = $this->splitKeys($words, $split);
         $proc['#conjunction'] = 'AND';
       }
+      else {
+        $proc = array_shift($words);
+      }
       return $proc;
     }
     foreach ($keys as $i => $key) {
       if (element_child($i)) {
-        $keys[$i] = $this->splitKeys($key);
+        $keys[$i] = $this->splitKeys($key, $split);
       }
     }
     return array_filter($keys);
@@ -915,7 +922,7 @@ class SearchApiDbService extends SearchApiAbstractService {
           $query->condition($or);
         }
         else {
-          $query->condition('word', $word);
+          $query->condition('word', '%' . db_like($word). '%', 'LIKE');
         }
         if (!isset($db_query)) {
           $db_query = $query;
@@ -1017,7 +1024,6 @@ class SearchApiDbService extends SearchApiAbstractService {
         $db_query->condition($or);
       }
     }
-
     return $db_query;
   }
 
@@ -1061,21 +1067,24 @@ class SearchApiDbService extends SearchApiAbstractService {
         if (!isset($fields[$f[0]])) {
           throw new SearchApiException(t('Unknown field in filter clause: @field.', array('@field' => $f[0])));
         }
+        $field = $fields[$f[0]];
         if ($f[1] === NULL) {
-          $query = db_select($fields[$f[0]]['table'], 't')
+          $query = db_select($field['table'], 't')
             ->fields('t', array('item_id'));
           $cond->condition('t.item_id', $query, $f[2] == '<>' || $f[2] == '!=' ? 'IN' : 'NOT IN');
           continue;
         }
-        if (search_api_is_text_type($fields[$f[0]]['type'])) {
-          // #negation is set here purely because we don't want any score.
-          $keys = array('#conjunction' => 'AND', '#negation' => TRUE, $f[1]);
-          $keys = $this->prepareKeys($keys);
-          $query = $this->createKeysQuery($keys, array($fields[$f[0]]), $fields);
-          $cond->condition('t.item_id', $query, $f[2] == '<>' || $f[2] == '!=' ? 'NOT IN' : 'IN');
+
+        if (search_api_is_text_type($field['type'])) {
+          $keys = $this->prepareKeys($f[1], FALSE);
+          $query = $this->createKeysQuery($keys, array($field), $fields);
+          // We don't need the score.
+          $query_expressions = &$query->getExpressions();
+          $query_expressions = array();
+          //$cond->condition('t.item_id', $query, $f[2] == '<>' || $f[2] == '!=' ? 'NOT IN' : 'IN');
         }
         else {
-          $alias = $this->getTableAlias($fields[$f[0]], $db_query, search_api_is_list_type($fields[$f[0]]['type']));
+          $alias = $this->getTableAlias($field, $db_query, search_api_is_list_type($field['type']));
           $cond->condition($alias . '.value', $f[1], $f[2]);
         }
       }
@@ -1152,12 +1161,10 @@ class SearchApiDbService extends SearchApiAbstractService {
       if ($facet['min_count'] > 1) {
         $select->having('num >= :count', array(':count' => $facet['min_count']));
       }
-      $list_or_text = search_api_is_list_type($field['type']) || search_api_is_text_type($field['type']);
-      if (((bool) $facet['missing']) === $list_or_text) {
-        // For multi-valued fields, the "missing" facet is defined by the table
-        // not having any entries for those items. We therefore need to execute
-        // an additional query, counting the items which do not have any entries
-        // in the field table.
+      if ($facet['missing']) {
+        // The "missing" facet is defined by the table not having any entries
+        // for those items. We therefore need to execute an additional query,
+        // counting the items which do not have any entries in the field table.
         if ($facet['missing']) {
           $inner_query = db_select($field['table'], 't1')
             ->fields('t1', array('item_id'));
@@ -1167,12 +1174,6 @@ class SearchApiDbService extends SearchApiAbstractService {
           $missing_count = $missing_count->execute()->fetchField();
           $missing_count = $missing_count >= $facet['min_count'] ? $missing_count : 0;
         }
-        // For single-valued fields, there are explicit NULL values in the
-        // table for "missing" entries. Therefore, we have to exclude NULL
-        // values if we do not want a "missing" facet.
-        else {
-          $select->isNotNull('value');
-        }
       }
 
       $terms = array();
@@ -1231,4 +1232,3 @@ class SearchApiDbService extends SearchApiAbstractService {
   }
 
 }
-
