diff --git a/includes/search_api_attachments_views_handler_attachments_filter.inc b/includes/search_api_attachments_views_handler_attachments_filter.inc
new file mode 100644
index 0000000..5043c85
--- /dev/null
+++ b/includes/search_api_attachments_views_handler_attachments_filter.inc
@@ -0,0 +1,97 @@
+<?php
+
+/**
+ * @file
+ * Contains SearchApiAttachmentsViewsHandlerAttachmentsFilter.
+ */
+
+/**
+ * Views filter handler class to filter attachments results.
+ */
+class SearchApiAttachmentsViewsHandlerAttachmentsFilter extends views_handler_filter {
+
+  /**
+   * The value of the filter.
+   *
+   * @var string
+   */
+  public $value;
+
+  /**
+   * The associated views query object.
+   *
+   * @var SearchApiViewsQuery
+   */
+  public $query;
+
+  /**
+   * Provide a list of options for the operator form.
+   */
+  public function operator_options() {
+//    return array(
+//      '<' => t('Is less than'),
+//      '<=' => t('Is less than or equal to'),
+//      '=' => t('Is equal to'),
+//      '<>' => t('Is not equal to'),
+//      '>=' => t('Is greater than or equal to'),
+//      '>' => t('Is greater than'),
+//      'empty' => t('Is empty'),
+//      'not empty' => t('Is not empty'),
+//    );
+  }
+
+  /**
+   * Provide a form for setting the filter value.
+   */
+  public function value_form(&$form, &$form_state) {
+    $form['value'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Exclude search in attachments'),
+//      '#options' => array(
+//        'include_all' => t('Search also in attachments'),
+//        'exclude_all' => t("Don't search in attachments"),
+//      ),
+      '#default_value' => isset($this->value) ? $this->value : 0,
+    );
+  }
+
+  /**
+   * Display the filter on the administrative summary
+   */
+  function admin_summary() {
+    if (!empty($this->options['exposed'])) {
+      return t('exposed');
+    }
+
+    if (empty($this->value)) {
+      return t('include attachments');
+    }
+
+    if ($this->value == 1) {
+      return t('exclude attachments');
+    }
+
+    return check_plain((string) $this->value);
+  }
+
+  /**
+   * Add this filter to the query.
+   */
+  public function query() {
+    if (empty($this->value[0])) {
+      return;
+    }
+
+    // Loop through all defined fields and remove those starting by
+    // 'attachments_' prefix.
+    $fields = $this->query->getFields();
+    foreach ($fields as $i => $field_name) {
+      $prefix = 'attachments_';
+      if (strpos($field_name, $prefix) === 0) {
+        unset($fields[$i]);
+      }
+    }
+    $this->query->fields($fields);
+  }
+
+}
diff --git a/search_api_attachments.module b/search_api_attachments.module
index e31ec8e..e913b56 100644
--- a/search_api_attachments.module
+++ b/search_api_attachments.module
@@ -23,6 +23,15 @@ function search_api_attachments_menu() {
 }
 
 /**
+ * Implementation of hook_views_api().
+ */
+function search_api_attachments_views_api() {
+  return array(
+    'api' => '3.0',
+  );
+}
+
+/**
  * Implements hook_search_api_alter_callback_info().
  */
 function search_api_attachments_search_api_alter_callback_info() {
diff --git a/search_api_attachments.views.inc b/search_api_attachments.views.inc
new file mode 100644
index 0000000..a72e540
--- /dev/null
+++ b/search_api_attachments.views.inc
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * Implements hook_views_data_alter().
+ */
+function search_api_attachments_views_data_alter(&$data) {
+  // Add the filter for each Search API's index.
+  foreach (search_api_index_load_multiple(FALSE) as $index) {
+    $key = 'search_api_index_' . $index->machine_name;
+    $data[$key]['search_api_attachments_attachments_filter']['title'] = 'Filter attachments results';
+    $data[$key]['search_api_attachments_attachments_filter']['group'] = t('Search');
+    $data[$key]['search_api_attachments_attachments_filter']['help'] = t('Include or exclude attachments search results.');
+    $data[$key]['search_api_attachments_attachments_filter']['filter']['handler'] = 'SearchApiAttachmentsViewsHandlerAttachmentsFilter';
+  }
+}
