/**
  * @param StandardSearchIndexerInterface $category
  * @param Value $value
  * @param mixed $subject
  */
 public function indexEntry(CategoryInterface $category, AttributeValueInterface $value, $subject)
 {
     $columns = $this->connection->getSchemaManager()->listTableColumns($category->getIndexedSearchTable());
     $attributeValue = $value->getSearchIndexValue();
     $details = $category->getSearchIndexFieldDefinition();
     $primary = $details['primary'][0];
     $primaryValue = $category->getIndexedSearchPrimaryKeyValue($subject);
     $columnValues = array();
     /**
      * @var $exists Statement
      */
     $exists = $this->connection->query("select count({$primary}) from {$category->getIndexedSearchTable()} where {$primary} = {$primaryValue}")->fetchColumn();
     if (is_array($attributeValue)) {
         foreach ($attributeValue as $valueKey => $valueValue) {
             $col = $this->getIndexEntryColumn($value->getAttributeKey(), $valueKey);
             if (isset($columns[strtolower($col)])) {
                 $columnValues[$col] = $valueValue;
             }
         }
     } else {
         $col = $this->getIndexEntryColumn($value->getAttributeKey());
         if (isset($columns[strtolower($col)])) {
             $columnValues[$col] = $attributeValue;
         }
     }
     if (count($columnValues)) {
         $primaries = array($primary => $primaryValue);
         if ($exists) {
             $this->connection->update($category->getIndexedSearchTable(), $columnValues, $primaries);
         } else {
             $this->connection->insert($category->getIndexedSearchTable(), $primaries + $columnValues);
         }
     }
 }