diff --git a/search_api_attachments.info b/search_api_attachments.info
index adf293f..b3ee39b 100644
--- a/search_api_attachments.info
+++ b/search_api_attachments.info
@@ -7,3 +7,4 @@ package = Search
 
 configure = admin/config/search/search_api/attachments
 files[] = includes/callback_attachments_settings.inc
+files[] = views/includes/search_api_attachments_views_handler_attachments_filter.inc
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..1a016e1
--- /dev/null
+++ b/search_api_attachments.views.inc
@@ -0,0 +1,18 @@
+<?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;
+    $table = &$data[$key];
+    $name = 'saa_exclude_attachments';
+    $table[$name] = array();
+    $table[$name]['group'] = t('Search');
+    $table[$name]['title'] = t('Exclude attachments');
+    $table[$name]['help'] = t('Exclude or include attachments in search query.');
+    $table[$name]['filter']['handler'] = 'SearchApiAttachmentsViewsHandlerAttachmentsFilter';
+  }
+}
diff --git a/views/includes/search_api_attachments_views_handler_attachments_filter.inc b/views/includes/search_api_attachments_views_handler_attachments_filter.inc
new file mode 100644
index 0000000..ab9db5a
--- /dev/null
+++ b/views/includes/search_api_attachments_views_handler_attachments_filter.inc
@@ -0,0 +1,87 @@
+<?php
+
+/**
+ * @file
+ * Contains SearchApiAttachmentsViewsHandlerAttachmentsFilter.
+ */
+
+/**
+ * Views filter handler class to filter attachments results.
+ */
+class SearchApiAttachmentsViewsHandlerAttachmentsFilter extends views_handler_filter {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function option_definition() {
+    $options = parent::option_definition();
+    $options['saa_exclude_attachments'] = array('default' => 0);
+    return $options;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['saa_exclude_attachments'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Exclude search in attachments'),
+      '#default_value' => $this->options['saa_exclude_attachments'],
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function admin_summary() {
+    if (!empty($this->options['exposed'])) {
+      return t('exposed');
+    }
+
+    if ($this->value == 0) {
+      return t('Include attachments');
+    }
+
+    if ($this->value == 1) {
+      return t('Exclude attachments');
+    }
+
+    return check_plain((string) $this->value);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  function exposed_form(&$form, &$form_state) {
+    if (empty($this->options['exposed'])) {
+      return;
+    }
+    $form['saa_exclude_attachments'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Exclude search in attachments'),
+      '#default_value' => $this->options['saa_exclude_attachments'],
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  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 $key => $field_name) {
+      $prefix = 'attachments_';
+      if (strpos($field_name, $prefix) === 0) {
+        unset($fields[$key]);
+      }
+    }
+    $this->query->fields($fields);
+  }
+
+}
