Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_sort.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * Class for sorting for a field.
+ */
+class apachesolr_views_handler_sort extends views_handler_sort {
+  
+  /**
+   * Places the sort into the search parameters.
+   */
+  public function query() {
+    /* These fields have a special "*_sort" field for sorting: */
+    $special_sort_fields = array(
+      'name' => 'name_sort',
+      'title' => 'title_sort',
+    );
+    $order = strtolower($this->options['order']);
+    
+    if (empty($special_sort_fields[$this->real_field])) {
+      $this->query->set_param('sort',
+          $this->real_field . ' ' . $order);
+    }
+    else {
+      $this->query->set_param('sort',
+          $special_sort_fields[$this->real_field] . ' ' . $order);
+    }
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_type.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_type.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_field_type.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_field_type.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * Class for rendering the node type.
+ */
+class apachesolr_views_handler_field_type
+    extends apachesolr_views_handler_field {
+  
+  /**
+   * Render the field value.
+   */
+  public function render($values) {
+    return $this->render_link(
+        node_get_types('name', $values[$this->real_field]), $values);
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_argument.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Class that allows searching the site with Apache Solr through a view.
+ */
+class apachesolr_views_handler_argument extends views_handler_argument {
+  
+  /**
+   * Add argument to query.
+   */
+  public function query() {
+    $this->query->add_term(apachesolr_views_query::escape_term($this->argument),
+        $this->real_field);
+  }
+  
+}
Index: contrib/apachesolr_views/apachesolr_views_query.inc
===================================================================
RCS file: contrib/apachesolr_views/apachesolr_views_query.inc
diff -N contrib/apachesolr_views/apachesolr_views_query.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/apachesolr_views_query.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,428 @@
+<?php
+
+/**
+ * Class for handling a view that gets its data not from the database, but from
+ * a Solr server.
+ */
+class apachesolr_views_query extends views_plugin_query {
+  
+  /** Array storing the keys that will be used for the search. */
+  private $_keys;
+  
+  /** String containing the query that will be handed to Solr. */
+  private $_query;
+  
+  /** Object encapsulating the actual query to Solr. */
+  private $_query_object;
+  
+  /** Array containing the parameters that will be handed to Solr. */
+  private $_params;
+  
+  /**
+   * An array of all required fields.
+   * Used for omitting unecessary expensive operations.
+   */
+  private $_used_fields;
+  
+  /** The object used for communitcating with the solr server. */
+  private $_solr;
+  
+  /** The Solr service class. */
+  private $_service_class;
+  
+  
+  /*
+   * Functions required by the views query class interface
+   */
+  
+  /**
+   * Constructor; Create the basic query object and fill with default values.
+   */
+  public function init($base_table, $base_field) {
+    $this->_keys = array();
+    $this->_used_fields = array();
+    $this->_params = $this->_get_params();
+    $params['fl'] = 'id,nid,title,comment_count,type,created,changed,url,' .
+          'uid,name,language,tid';
+    
+    // Copied from apachesolr_get_solr().
+    // TODO Refactor
+    list($module, $filepath, $class) = variable_get('apachesolr_service_class',
+        array('apachesolr', 'Drupal_Apache_Solr_Service.php',
+            'Drupal_Apache_Solr_Service'));
+    include_once(drupal_get_path('module', $module) .'/'. $filepath);
+    $this->_service_class = $class;
+  }
+  
+  /**
+   * Generate a query and a countquery from all of the information supplied
+   * to the object.
+   *
+   * @param $get_count
+   *   Provide a countquery if this is true, otherwise provide a normal query.
+   */
+  public function query($get_count = FALSE) {
+    if (!empty($this->_query)) {
+      return $this->_query;
+    }
+    // TODO self::log(print_r($this, TRUE));
+    
+    if (empty($this->_keys)) {
+      // TODO Or just set '' query and then display error message in execute()?
+      // Argument handler should handle missing argument according to settings,
+      // and if no argument handler is used, this behaviour may be even less
+      // desired. Should we then just return an empty result, like in the
+      // default query? Without error message? Probably, yes...
+      // TODO "*:*" doesn't even seem to function any more.
+      $this->_query = "Duis";
+    }
+    else if (count($this->_keys)) {
+      $this->_query = $this->_keys[0];
+    }
+    else {
+      $this->_query = '(' . implode(') (', $this->_keys) . ')';
+    }
+    
+    $this->_query_object = apachesolr_current_query($this->_query);
+    return $this->_query;
+  }
+  
+  /**
+   * Let modules modify the query just prior to finalizing it.
+   */
+  public function alter(&$view) {
+    // TODO Is this the right thing to do? Or copy from default query?
+    apachesolr_modify_query($this->_query, $this->_params);
+  }
+  
+  /**
+   * Executes the query and fills the associated view object with according
+   * values.
+   * 
+   * Values to set: $view->result, $view->total_rows, $view->execute_time,
+   * $view->pager['current_page'].
+   */
+  public function execute(&$view) {
+    $start_time = views_microtime();
+    $view->result = array();
+    $query = $this->_query_object;
+    $params = $this->_params;
+    $solr = $this->_solr;
+    
+    if (empty($query)) {
+      $view->execute_time = 0;
+      return;
+    }
+    
+    try {
+      // Since only now the query is known, we couldn't do this earlier
+      // (i.e., in _get_params())
+      if (variable_get('apachesolr_search_spellcheck', FALSE)) {
+        //Add new parameter to the search request
+        $params['spellcheck.q'] = $this->_query_object->get_query_basic();
+        $params['spellcheck'] = 'true';
+      }
+      
+      // We default to getting snippets from the body.
+      $hl_fl = is_null($params['hl.fl']) ? 'body' : $params['hl.fl'];
+
+      $response = $solr->search($query->get_query_basic(), $params['start'],
+          $params['rows'], $params);
+      // TODO self::log(print_r($response, TRUE));
+      
+      $view->total_rows = $total = $response->response->numFound;
+      $view->pager['current_page'] = $params['start'] / $params['rows'];
+      
+      // The response is cached so that it is accessible to the blocks and
+      // anything else that needs it beyond the initial search.
+      apachesolr_static_response_cache($response);
+      apachesolr_has_searched(TRUE);
+      pager_query("SELECT %d", $params['rows'], 0, NULL, $total);
+      
+      if ($total > 0) {
+        $results = array();
+        
+        foreach ($response->response->docs as $doc) {
+          // Maybe we can ommit some expensive operations...
+          
+          // body:
+          $snippet = '';
+          if (!empty($this->_used_fields['body'])) {
+            $snippet = isset($response->highlighting->{$doc->id}->$hl_fl)
+                ? theme('apachesolr_search_snippets', $doc,
+                    $response->highlighting->{$doc->id}->$hl_fl)
+                : '';
+          }
+          
+          // taxonomies:
+          $taxonomies = '';
+          if (!empty($this->_used_fields['taxonomies'])
+              && is_array($doc->tid)) {
+            $taxonomies = array();
+            while (!empty($doc->tid) && !empty($doc->taxonomy_name)) {
+              $tid = array_shift($doc->tid);
+              $name = array_shift($doc->taxonomy_name);
+              $taxonomies[] = l($name, 'taxonomy/term/' . $tid,
+                  array('absolute' => TRUE));
+            }
+            $taxonomies = implode(', ', $taxonomies);
+          }
+          
+          // created:
+          if (!empty($this->_used_fields['created'])) {
+            $doc->created = strtotime($doc->created);
+          }
+          
+          // changed:
+          if (!empty($this->_used_fields['changed'])) {
+            $doc->changed = strtotime($doc->changed);
+          }
+          
+          // Now add result
+          $results[] = array(
+            'nid' => $doc->nid,
+            'title' => $doc->title,
+            'created' => $doc->created,
+            'changed' => $doc->changed,
+            'type' => $doc->type,
+            'name' => $doc->name,
+            'uid' => $doc->uid,
+            'body' => $snippet,
+            'comment_count' => $doc->comment_count,
+            'taxonomies' => $taxonomies,
+            'language' => $doc->language,
+            'link' => $doc->url,
+          );
+        }
+
+        // Hook to allow modifications of the retrieved results
+        foreach (module_implements('apachesolr_process_results') as $module) {
+          $function = $module .'_apachesolr_process_results';
+          call_user_func_array($function, array(&$results));
+        }
+        
+        $view->result = $results;
+      }
+    }
+    catch (Exception $e) {
+      watchdog('Apache Solr', $e->getMessage(), NULL, WATCHDOG_ERROR);
+      apachesolr_failure(t('Solr search'), is_null($query) ? $this->_keys : $query->get_query_basic());
+    }
+    
+    $view->execute_time = views_microtime() - $start_time;
+  }
+  
+  //TODO I hope we can delete this soon
+  public function get_where_args() {
+    return array();
+  }
+  
+  
+  /*
+   * Functions offered for apachesolr-specific handlers, etc.
+   */
+  
+  /** Adds the specified term to the query. */
+  public function add_term($term, $field = 'text') {
+    if ($field != 'text') {
+      $term = $field . ':' . $term; 
+    }
+    $this->_keys[] = $term;
+  }
+  
+  /**
+   * Add a group of search terms to the query, which will be connected by OR
+   * operators.
+   * 
+   * @param $terms an array where each entry must be either of the form
+   *     array('term' => $term, 'field' => $field);
+   * (the 'field' entry can be omitted, in which case 'text' is assumed), or
+   *     $term
+   */
+  public function add_or_group($terms) {
+    if (count($terms) == 0 || !is_array($terms)) {
+      return;
+    }
+    $keys = array();
+    foreach ($terms as $term) {
+      if (is_array($term)) {
+        if (empty($term['field']) || $term['field'] == 'text') {
+          $keys[] = $term['term'];
+        }
+        else {
+          $keys[] = $term['field'] . ':' . $term['term'];
+        }
+      }
+      else {
+        $keys[] = $term;
+      }
+    }
+    $this->_keys[] = '(' . implode(' OR ', $keys) . ')';
+  }
+  
+  /** Sets the specified Solr search parameter to the specified value. */
+  public function set_param($param, $value) {
+    $this->_params[$param] = $value;
+  }
+  
+  /** Get the specified Solr search parameter. */
+  public function get_param($param) {
+    return isset($this->_params[$param]) ? $this->_params[$param] : '';
+  }
+  
+  /**
+   * Adds the specified parameters to the Solr search parameters, overwriting
+   * old values where necessary. Parameters must be specified as
+   * $param => $value in the array.
+   */
+  public function set_params($params) {
+    $this->_params = $params + $this->_params;
+  }
+  
+  /** Add a field to retrieve. */
+  public function add_field($field) {
+    $this->_used_fields[$field] = TRUE;
+  }
+  
+  
+  /*
+   * (Public and private) helper functions
+   */
+  
+  /** Escapes a term for passing it to the query. */
+  public static function escape_term($term) {
+    $term = trim($term);
+    if (empty($term)) {
+      return '';
+    }
+    if (($term{0} == '"' && $term{strlen($term)-1} == '"')
+        || $term{0} == '(' && $term{strlen($term)-1} == ')') {
+      return $term;
+    }
+    if (strpos($term, ' ') !== FALSE) {
+      return Apache_Solr_Service::phrase($term);
+    }
+    return Apache_Solr_Service::escape($term);
+  }
+  
+  /**
+   * Returns the parameters that will be handed to Solr along with the query.
+   */
+  private function _get_params() {
+    // Whole method copied from
+    //   apachesolr_search.module:101-209: apachesolr_search_search()
+    // TODO Refactor, so both this class and apachesolr_search_search() call new
+    //      function, ~apachesolr_get_params().
+    //      (If apachesolr_search_get_params() is used, add apachesolr_search to
+    //      dependencies in .info.)
+    $params = array(
+      'fl' => 'id,nid,title,comment_count,type,created,changed,score,url,' .
+          'uid,name',
+      'rows' => variable_get('apachesolr_rows', 10),
+      'facet' => 'true',
+      'facet.mincount' => 1,
+      'facet.sort' => 'true'
+    );
+
+    /**
+     * Highlighting settings
+     * These settings are set in solrconfig.xml.
+     * See the defaults there.
+     * If you wish to override them, you can via settings.php
+     */
+
+    $params['hl'] = variable_get('apachesolr_hl_active', NULL);
+    $params['hl.fragsize']= variable_get('apachesolr_hl_textsnippetlength', NULL);
+    $params['hl.simple.pre'] = variable_get('apachesolr_hl_pretag', NULL);
+    $params['hl.simple.post'] = variable_get('apachesolr_hl_posttag', NULL);
+    $params['hl.snippets'] = variable_get('apachesolr_hl_numsnippets', NULL);
+    $params['hl.fl'] = variable_get('apachesolr_hl_fieldtohightlight', NULL);
+
+    $facet_query_limits = variable_get('apachesolr_facet_query_limits', array());
+    // Request all enabled facets.
+    foreach (apachesolr_get_enabled_facets() as $module => $module_facets) {
+      foreach($module_facets as $delta => $facet_field) {
+        $params['facet.field'][] = $facet_field;
+        // Facet limits
+        if (isset($facet_query_limits[$module][$delta])) {
+          $params['f.' . $facet_field . '.facet.limit'] = $facet_query_limits[$module][$delta];
+        }
+      }
+    }
+    if (!empty($params['facet.field'])) {
+      // Add a default limit for fields where no limit was set.
+      $params['facet.limit'] = variable_get('apachesolr_facet_query_limit_default', 20);
+    }
+
+    if (isset($_GET['solrsort'])) {
+      $sort = check_plain($_GET['solrsort']);
+    }
+
+    // Validate sort parameter
+    if (isset($sort) && preg_match('/^([a-z0-9_]+ (asc|desc)(,)?)+$/i', $sort)) {
+      $params['sort'] = $sort;
+    }
+
+    $page = isset($_GET['page']) ? $_GET['page'] : 0;
+    $params['start'] = $page * $params['rows'];
+    // This is the object that does the communication with the solr server.
+    $solr = $this->_solr = apachesolr_get_solr();
+
+    // Note - we have query fields set in solrconfig.xml, which will operate when
+    // none are set.
+    $qf = variable_get('apachesolr_search_query_fields', array());
+    $fields = $solr->getFields();
+    if ($qf && $fields) {
+      foreach ($fields as $field_name => $field) {
+        if (!empty($qf[$field_name])) {
+          if ($field_name == 'body') {
+            // Body is the only normed field.
+            $qf[$field_name] *= 40.0;
+          }
+          $params['qf'][] = $field_name . '^'. $qf[$field_name];
+        }
+      }
+    }
+    // Note: we use 2 since 1 fails on Ubuntu Hardy.
+    $data = $solr->getLuke(2);
+    if (isset($data->index->numDocs)) {
+      $total = $data->index->numDocs;
+    }
+    else {
+      $total = db_result(db_query("SELECT COUNT(nid) FROM {node}"));
+    }
+    $date_settings = variable_get('apachesolr_search_date_boost', '4:200.0');
+    list($date_steepness, $date_boost) = explode(':', $date_settings);
+    // Default date-biasing function, as suggested (but steeper) at
+    // http://wiki.apache.org/solr/DisMaxRequestHandler
+    // rord() returns 1 for the newset doc, and the number in the index for
+    // the oldest doc.  The function is thus: $total/(rord()*$steepness + $total).
+    if ($date_boost) {
+      $params['bf'][] = "recip(rord(created),$date_steepness,$total,$total)^$date_boost";
+    }
+    $comment_settings = variable_get('apachesolr_search_comment_boost', '4:200.0');
+    list($comment_steepness, $comment_boost) = explode(':', $comment_settings);
+    // Default date-biasing function, as suggested (but steeper) at
+    // http://wiki.apache.org/solr/DisMaxRequestHandler
+    // rord() returns 1 for the newset doc, and the number in the index for
+    // the oldest doc.  The function is thus: $total/(rord()*$steepness + $total).
+    if ($comment_boost) {
+      $params['bf'][] = "recip(rord(comment_count),$comment_steepness,$total,$total)^$comment_boost";
+    }
+
+    // Modify the weight of results according to the node types.
+    $type_boosts = variable_get('apachesolr_search_type_boosts', array());
+    if (!empty($type_boosts)) {
+      foreach ($type_boosts as $type => $boost) {
+        $params['bq'][] = "type:$type^$boost";
+      }
+    }
+    
+    return $params;
+  }
+  
+  private static function log($msg) {
+    watchdog('Apache Solr', '<pre>' . $msg . '</pre>', NULL, WATCHDOG_DEBUG);
+  }
+    
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_type.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_type.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_type.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_type.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * Class for filtering by type.
+ */
+class apachesolr_views_handler_filter_type extends views_handler_filter {
+  
+  public function option_definition() {
+    $options = parent::option_definition();
+
+    $options['operator'] = array('default' => 'one of');
+    $options['value'] = array('default' => '');
+
+    return $options;
+  }
+  
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $time = time();
+
+    $form['operator'] = array(
+      '#type' => 'select',
+      '#title' => t('Filter for'),
+      '#options' => array(
+        'one of' => t('One of these'),
+        'not one of' => t('Not one of these'),
+      ),
+      '#default_value' =>
+          isset($this->options['operator'])
+          ? $this->options['operator']
+          : 'one of',
+    );
+    $form['value'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Usernames'),
+      '#description' => t('Enter a comma seperated list of types.'),
+      '#default_value' =>
+          isset($this->options['value'])
+          ? $this->options['value']
+          : '',
+    );
+  }
+
+  public function query() {
+    $not = $this->options['operator'] == 'not one of';
+    $types = array_map('trim', explode(',', $this->options['value']));
+    foreach ($types as $i => $type) {
+      if (empty($type)) {
+        unset($types[$i]);
+      }
+    }
+    if (empty($types)) {
+      if (!$not) {
+        $this->query->add_term('nid:-1');//Add term that will yield no results
+      }
+    }
+    else if (count($types) == 1) {
+      $this->query->add_term(($not ? 'NOT ' : '') . 'type:' . 
+          array_shift($types));
+    }
+    else {
+      $key = 'type:' . array_shift($types);
+      foreach ($types as $type) {
+        $key .= ' OR type:' . $type;
+      }
+      $this->query->add_term($not ? 'NOT (' . $key . ')' : $key);
+    }
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_search.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_search.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_search.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Class that allows searching the site with Apache Solr through a view.
+ */
+class apachesolr_views_handler_filter_search extends views_handler_filter_string {
+  
+  /**
+   * Override options to remove case sensitivity option.
+   */
+  public function option_definition() {
+    $options = parent::option_definition();
+    unset($options['case']);
+    return $options;
+  }
+  
+  /**
+   * Override options to remove case sensitivity option.
+   */
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    unset($form['case']);
+  }
+  
+  /**
+   * Override list of available operators.
+   */
+  public function operators() {
+    $operators = array(
+      'append' => array(
+        'title' => t('Append to query'),
+        'short' => '',
+        'method' => 'query',
+        'values' => 1,
+      ),
+    );
+
+    return $operators;
+  }
+  
+  public function query() {
+    if (!empty($this->value)) {
+      $this->query->add_term($this->value);
+    }
+  }
+  
+  public function admin_summary() {
+    if (!empty($this->options['exposed'])) {
+      return t('exposed');
+    }
+
+    return $this->value;
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_field.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * Default class for a field of the apachesolr base table. Inherits from the
+ * node default class and overrides methods where necessary.
+ */
+class apachesolr_views_handler_field extends views_handler_field_node {
+  
+  /** We don't need to ensure any tables. */
+  public function ensure_my_table() {}
+  
+  /**
+   * Tell the query object to retrieve this field.
+   */
+  public function query() {
+    $this->query->add_field($this->real_field);
+  }
+  
+  /**
+   * Render the field value.
+   * 
+   * This is copied from views_handler_field_node, but without the indirection
+   * via $field_alias, since in Apache Solr there are no field aliases.
+   */
+  public function render($values) {
+    return $this->render_link(check_plain($values[$this->real_field]), $values);
+  }
+  
+  /**
+   * Render whatever the data is as a link to the node.
+   * 
+   * This is copied from views_handler_field_node, but without the indirection
+   * via the aliases table, since in Apache Solr there are no field aliases.
+   */
+  public function render_link($data, $values) {
+    if (!empty($this->options['link_to_node'])
+        && $data !== NULL && $data !== '') {
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = $values['link'];
+    }
+    return $data;
+  }
+  
+  /**
+   * Called when click-sorting.
+   */
+  public function click_sort($order) {
+    /* These fields have a special "*_sort" field for sorting: */
+    $special_sort_fields = array(
+      'name' => 'name_sort',
+      'title' => 'title_sort',
+    );
+    
+    if (empty($special_sort_fields[$this->real_field])) {
+      $this->query->set_param('sort',
+          $this->real_field . ' ' . strtolower($order));
+    }
+    else {
+      $this->query->set_param('sort',
+          $special_sort_fields[$this->real_field] . ' ' . strtolower($order));
+    }
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_author.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_author.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_field_author.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_field_author.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * Class for rendering the node author.
+ */
+class apachesolr_views_handler_field_author
+    extends apachesolr_views_handler_field {
+  
+  public function option_definition() {
+    $options = parent::option_definition();
+    if (isset($options['link_to_node'])) {
+      unset($options['link_to_node']);
+    }
+    $options['link_to_profile'] = array('default' => TRUE);
+    return $options;
+  }
+
+  /**
+   * Provide link_to_profile option
+   */
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    if (isset($form['link_to_node'])) {
+      unset($form['link_to_node']);
+    }
+    $form['link_to_profile'] = array(
+      '#title' => t("Link the name to the user's profile."),
+      '#type' => 'checkbox',
+      '#default_value' => !empty($this->options['link_to_profile']),
+    );
+  }
+
+  /**
+   * If the link_to_profile option is set, render the field as a link to the
+   * user's profile.
+   */
+  function render_link($data, $values) {
+    if (!empty($this->options['link_to_profile']) && $data !== NULL && $data !== '') {
+      $this->options['alter']['make_link'] = TRUE;
+      $this->options['alter']['path'] = "user/" . $values['uid'];
+    }
+    return $data;
+  }
+  
+}
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_author.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_author.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_author.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_filter_author.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,85 @@
+<?php
+
+/**
+ * Class for filtering by users.
+ */
+class apachesolr_views_handler_filter_author extends views_handler_filter {
+  
+  public function option_definition() {
+    $options = parent::option_definition();
+
+    $options['operator'] = array('default' => 'one of');
+    $options['value'] = array('default' => '');
+
+    return $options;
+  }
+  
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $time = time();
+
+    $form['operator'] = array(
+      '#type' => 'select',
+      '#title' => t('Filter for'),
+      '#options' => array(
+        'one of' => t('One of these'),
+        'not one of' => t('Not one of these'),
+        'current' => t('Current user'),
+        'not current' => t('Not current user'),
+      ),
+      '#default_value' =>
+          isset($this->options['operator'])
+          ? $this->options['operator']
+          : 'one of',
+    );
+    $form['value'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Usernames'),
+      '#description' => t('Enter a comma seperated list of user names.'),
+      '#default_value' =>
+          isset($this->options['value'])
+          ? $this->options['value']
+          : '',
+      '#process' => array('views_process_dependency'),
+      '#dependency' =>
+          array('edit-options-operator' => array('one of', 'not one of')),
+    );
+  }
+
+  public function query() {
+    if ($this->options['operator'] == 'current') {
+      global $user;
+      $this->query->add_term($user->uid, 'uid');
+    }
+    else if ($this->options['operator'] == 'not current') {
+      global $user;
+      $this->query->add_term('NOT uid:' . $user->uid);
+    }
+    else {
+      $not = $this->options['operator'] == 'not one of';
+      $names = array_map('trim', explode(',', $this->options['value']));
+      foreach ($names as $i => $name) {
+        if (empty($name)) {
+          unset($names[$i]);
+        }
+      }
+      if (empty($names)) {
+        if (!$not) {
+          $this->query->add_term('nid:-1');//Add term that will yield no results
+        }
+      }
+      else if (count($names) == 1) {
+        $this->query->add_term(($not ? 'NOT ' : '') . 'name:' . 
+            array_shift($names));
+      }
+      else {
+        $key = 'name:' . array_shift($names);
+        foreach ($names as $name) {
+          $key .= ' OR name:' . $name;
+        }
+        $this->query->add_term($not ? 'NOT (' . $key . ')' : $key);
+      }
+    }
+  }
+  
+}
Index: contrib/apachesolr_views/apachesolr_views.info
===================================================================
RCS file: contrib/apachesolr_views/apachesolr_views.info
diff -N contrib/apachesolr_views/apachesolr_views.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/apachesolr_views.info	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,8 @@
+; $Id$
+name = Apache Solr Views Integration
+description = Lets the user display Apache Solr search results within a view.
+dependencies [] = apachesolr
+dependencies [] = apachesolr_search
+dependencies [] = views
+package = "Apache Solr"
+core = "6.x"
Index: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc
===================================================================
RCS file: contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc
diff -N contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/handlers/apachesolr_views_handler_field_date.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * Class for rendering the node type.
+ * Largely copied from views_handler_field_date.
+ */
+class apachesolr_views_handler_field_date
+    extends apachesolr_views_handler_field {
+  
+  public function option_definition() {
+    $options = parent::option_definition();
+
+    $options['date_format'] = array('default' => 'small');
+    $options['custom_date_format'] = array('default' => '');
+
+    return $options;
+  }
+  
+  public function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $time = time();
+
+    $form['date_format'] = array(
+      '#type' => 'select',
+      '#title' => t('Date format'),
+      '#options' => array(
+        'small' => format_date($time, 'small'),
+        'medium' => format_date($time, 'medium'),
+        'large' => format_date($time, 'large'),
+        'custom' => t('Custom'),
+        'time ago' => t('Time ago'),
+      ),
+      '#default_value' =>
+          isset($this->options['date_format'])
+          ? $this->options['date_format']
+          : 'small',
+    );
+    $form['custom_date_format'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Custom date format'),
+      '#description' => t('If "Custom", see <a href="!url" target="_blank">' .
+          'the PHP docs</a> for date formats. If "Time ago" this is the the ' .
+          'number of different units to display, which defaults to two.',
+          array('!url' => 'http://us.php.net/manual/en/function.date.php')),
+      '#default_value' =>
+          isset($this->options['custom_date_format'])
+          ? $this->options['custom_date_format']
+          : '',
+      '#process' => array('views_process_dependency'),
+      '#dependency' =>
+          array('edit-options-date-format' => array('custom', 'time ago')),
+    );
+  }
+
+  public function render($values) {
+    $value = $values[$this->real_field];
+    $format = $this->options['date_format'];
+    if ($format == 'custom' || $format == 'time ago') {
+      $custom_format = $this->options['custom_date_format'];
+    }
+
+    switch ($format) {
+      case 'time ago':
+        return $this->render_link(
+            $value
+            ? t('%time ago', array('%time' => format_interval(time() - $value,
+                is_numeric($custom_format) ? $custom_format : 2)))
+            : theme('views_nodate'), $values);
+      case 'custom':
+        return $this->render_link(
+            $value
+            ? format_date($value, $format, $custom_format)
+            : theme('views_nodate'), $values);
+      default:
+        return $this->render_link(
+            $value
+            ? format_date($value, $format)
+            : theme('views_nodate'), $values);
+    }
+  }
+  
+}
Index: contrib/apachesolr_views/apachesolr_views.views.inc
===================================================================
RCS file: contrib/apachesolr_views/apachesolr_views.views.inc
diff -N contrib/apachesolr_views/apachesolr_views.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/apachesolr_views.views.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,529 @@
+<?php
+
+// $Id: apachesolr_views.views.inc,v 1.1 2008/08/28 11:05:48 drunkenmonkey Exp $
+
+/*
+ * Load files with base classes of the contained classes.
+ */
+
+/**
+ * Implementation of hook_views_handlers().
+ */
+function apachesolr_views_views_handlers() {
+  return array(
+    'info' => array(
+      'path' => drupal_get_path('module', 'apachesolr_views') . '/handlers',
+    ),
+    'handlers' => array(
+      'apachesolr_views_handler_argument' => array(
+        'parent' => 'views_handler_argument',
+      ),
+      'apachesolr_views_handler_field' => array(
+        'parent' => 'views_handler_field_node',
+      ),
+      'apachesolr_views_handler_field_author' => array(
+        'parent' => 'apachesolr_views_handler_field',
+      ),
+      'apachesolr_views_handler_field_date' => array(
+        'parent' => 'apachesolr_views_handler_field',
+      ),
+      'apachesolr_views_handler_field_type' => array(
+        'parent' => 'apachesolr_views_handler_field',
+      ),
+      'apachesolr_views_handler_filter_author' => array(
+        'parent' => 'views_handler_filter',
+      ),
+      'apachesolr_views_handler_filter_search' => array(
+        'parent' => 'views_handler_filter_string',
+      ),
+      'apachesolr_views_handler_filter_type' => array(
+        'parent' => 'views_handler_filter',
+      ),
+      'apachesolr_views_handler_sort' => array(
+        'parent' => 'views_handler_sort',
+      ),
+    ),
+  );
+}
+
+/**
+ * Implementation of hook_views_plugins().
+ */
+function apachesolr_views_plugins() {
+  return array(
+    'module' => 'apachesolr_views',
+    'query' => array(
+      'apachesolr_views_query' => array(
+        'title' => t('Apache Solr Query'),
+        'help' => t('Query that allows you to search with Apache Solr.'),
+        'handler' => 'apachesolr_views_query',
+        'parent' => 'views_query',
+      ),
+    ),
+  );
+
+}
+
+/**
+ * Implementation of hook_views_data().
+ */
+function apachesolr_views_views_data() {
+  $data['apachesolr']['table']['group']  = t('Apache Solr');
+
+  $data['apachesolr']['table']['base'] = array(
+    'query class' => 'apachesolr_views_query',
+    'title' => t('Apache Solr'),
+    'help' => t('Searches the site with the Apache Solr search engine.'),
+  );
+
+  $data['apachesolr']['nid'] = array(
+    'title' => t('Nid'),
+    'help' => t('The node ID of the node.'),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['title'] = array(
+    'title' => t('Title'),
+    'help' => t('The title of the node.'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field',
+      'click sortable' => TRUE,
+     ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['created'] = array(
+    'title' => t('Creation date'),
+    'help' => t('The date the node was created.'),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['changed'] = array(
+    'title' => t('Updated date'),
+    'help' => t('The date the node was last updated.'),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['type'] = array(
+    'title' => t('Type'),
+    'help' => t('The type of a node (for example, "blog entry", "forum post", "story", etc).'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field_type',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_apachesolr_type',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['name'] = array(
+    'title' => t('Author'),
+    'help' => t("The node's author."),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field_author',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'apachesolr_views_handler_filter_author',
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['uid'] = array(
+    'title' => t('Author Uid'),
+    'help' => t("The node's author's user ID."),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field_author',
+      'click sortable' => TRUE,
+    ),
+  );
+  $data['apachesolr']['body'] = array(
+    'title' => t('Body'),
+    'help' => t("The node's content."),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field',
+      'click sortable' => FALSE,
+      'element type' => 'div',
+    ),
+  );
+  $data['apachesolr']['comment_count'] = array(
+    'title' => t('Comment count'),
+    'help' => t('The number of comments that were posted to the node.'),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'apachesolr_views_handler_sort',
+    ),
+  );
+  $data['apachesolr']['taxonomies'] = array(
+    'title' => t('Taxonomy terms'),
+    'help' => t('Taxonomy terms associated with the node.'),
+    'field' => array(
+      'handler' => 'apachesolr_views_handler_field',
+      'click sortable' => FALSE,
+    ),
+  );
+  if (module_exists('translation')) {
+    $data['apachesolr']['language'] = array(
+      'title' => t('Language'),
+      'help' => t('The language the node is in.'),
+      'argument' => array(
+        'handler' => 'apachesolr_views_handler_argument',
+      ),
+      'field' => array(
+        'handler' => 'apachesolr_views_handler_field',
+        'click sortable' => TRUE,
+      ),
+      'sort' => array(
+        'handler' => 'apachesolr_views_handler_sort',
+      ),
+    );
+  }
+  
+  $data['apachesolr']['text'] = array(
+    'title' => t('Search'),
+    'help' => t('Searches the content with Solr'),
+    'argument' => array(
+      'handler' => 'apachesolr_views_handler_argument',
+    ),
+    'filter' => array(
+      'handler' => 'apachesolr_views_handler_filter_search',
+    ),
+  );
+  
+  return $data;
+}
+
+/**
+ * Implementation of hook_views_default_views().
+ * 
+ * Returns a view for displaying apachesolr search results.
+ */
+function apachesolr_views_views_default_views() {
+  $view = new view;
+  $view->name = 'apachesolr_search_result';
+  $view->description = 'Display the results of the current Apache Solr search.';
+  $view->tag = 'apachesolr';
+  $view->view_php = '';
+  $view->base_table = 'node';
+  $view->is_cacheable = '0';
+  $view->api_version = 2;
+  $view->disabled = FALSE;
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('fields', array(
+    'title' => array(
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+    ),
+    'view_node' => array(
+      'id' => 'view_node',
+      'table' => 'node',
+      'field' => 'view_node',
+    ),
+    'timestamp' => array(
+      'id' => 'timestamp',
+      'table' => 'history_user',
+      'field' => 'timestamp',
+    ),
+    'name' => array(
+      'id' => 'name',
+      'table' => 'users',
+      'field' => 'name',
+    ),
+    'created' => array(
+      'id' => 'created',
+      'table' => 'node',
+      'field' => 'created',
+    ),
+    'edit_node' => array(
+      'id' => 'edit_node',
+      'table' => 'node',
+      'field' => 'edit_node',
+    ),
+    'delete_node' => array(
+      'id' => 'delete_node',
+      'table' => 'node',
+      'field' => 'delete_node',
+    ),
+  ));
+  $handler->override_option('filters', array(
+    'status_extra' => array(
+      'operator' => '=',
+      'value' => '',
+      'group' => '0',
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'id' => 'status_extra',
+      'table' => 'node',
+      'field' => 'status_extra',
+      'relationship' => 'none',
+    ),
+    'apachesolr' => array(
+      'operator' => '=',
+      'value' => '',
+      'group' => '0',
+      'exposed' => FALSE,
+      'expose' => array(
+        'operator' => FALSE,
+        'label' => '',
+      ),
+      'id' => 'apachesolr',
+      'table' => 'node',
+      'field' => 'apachesolr',
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'none',
+    'role' => array(),
+    'perm' => '',
+  ));
+  $handler->override_option('title', 'Search results');
+  $handler->override_option('use_ajax', TRUE);
+  $handler->override_option('use_pager', '1');
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option('style_options', array(
+    'grouping' => '',
+    'override' => 1,
+    'sticky' => 0,
+    'order' => 'asc',
+    'columns' => array(
+      'title' => 'title',
+      'view_node' => 'title',
+      'timestamp' => 'title',
+      'name' => 'name',
+      'created' => 'created',
+      'edit_node' => 'edit_node',
+      'delete_node' => 'edit_node',
+    ),
+    'info' => array(
+      'title' => array(
+        'sortable' => 1,
+        'separator' => ' ',
+      ),
+      'view_node' => array(
+        'separator' => '',
+      ),
+      'timestamp' => array(
+        'separator' => '',
+      ),
+      'name' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'created' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'edit_node' => array(
+        'separator' => ' | ',
+      ),
+      'delete_node' => array(
+        'separator' => '',
+      ),
+    ),
+    'default' => 'title',
+  ));
+  $handler = $view->new_display('block', 'Block', 'block_1');
+  $handler->override_option('block_description', 'ApacheSolr: Search results');
+  
+  // Add view to list of views to provide.
+  $views[$view->name] = $view;
+
+
+
+
+  $view = new view;
+  $view->name = 'apachesolr_search';
+  $view->description = 'Search the site with Apache Solr';
+  $view->tag = 'apachesolr';
+  $view->view_php = '';
+  $view->base_table = 'node';
+  $view->is_cacheable = '0';
+  $view->api_version = 2;
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('fields', array(
+    'title' => array(
+      'label' => 'Title',
+      'link_to_node' => 1,
+      'exclude' => 0,
+      'id' => 'title',
+      'table' => 'node',
+      'field' => 'title',
+      'relationship' => 'none',
+    ),
+    'timestamp' => array(
+      'label' => 'Has new content',
+      'link_to_node' => 0,
+      'comments' => 1,
+      'exclude' => 0,
+      'id' => 'timestamp',
+      'table' => 'history_user',
+      'field' => 'timestamp',
+      'relationship' => 'none',
+    ),
+    'name' => array(
+      'label' => 'Name',
+      'link_to_user' => 1,
+      'exclude' => 0,
+      'id' => 'name',
+      'table' => 'users',
+      'field' => 'name',
+      'relationship' => 'none',
+    ),
+    'created' => array(
+      'label' => 'Post date',
+      'date_format' => 'large',
+      'custom_date_format' => '',
+      'exclude' => 0,
+      'id' => 'created',
+      'table' => 'node',
+      'field' => 'created',
+      'relationship' => 'none',
+    ),
+    'edit_node' => array(
+      'label' => 'Edit link',
+      'text' => '',
+      'exclude' => 0,
+      'id' => 'edit_node',
+      'table' => 'node',
+      'field' => 'edit_node',
+      'relationship' => 'none',
+    ),
+    'delete_node' => array(
+      'label' => 'Delete link',
+      'text' => '',
+      'exclude' => 0,
+      'id' => 'delete_node',
+      'table' => 'node',
+      'field' => 'delete_node',
+      'relationship' => 'none',
+    ),
+  ));
+  $handler->override_option('arguments', array(
+    'apachesolr' => array(
+      'default_action' => 'ignore',
+      'style_plugin' => 'default_summary',
+      'style_options' => array(),
+      'wildcard' => '',
+      'wildcard_substitution' => '',
+      'title' => 'Search for %1',
+      'default_argument_type' => 'fixed',
+      'default_argument' => '',
+      'validate_type' => 'none',
+      'validate_fail' => 'not found',
+      'id' => 'apachesolr',
+      'table' => 'node',
+      'field' => 'apachesolr',
+      'relationship' => 'none',
+      'default_argument_user' => 0,
+      'default_argument_fixed' => '',
+      'default_argument_php' => '',
+      'validate_argument_node_type' => array(
+        'blog' => 0,
+        'page' => 0,
+        'story' => 0,
+      ),
+      'validate_argument_node_access' => 0,
+      'validate_argument_nid_type' => 'nid',
+      'validate_argument_vocabulary' => array(
+        '2' => 0,
+      ),
+      'validate_argument_type' => 'tid',
+      'validate_argument_php' => '',
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'none',
+    'role' => array(),
+    'perm' => '',
+  ));
+  $handler->override_option('title', 'Search results');
+  $handler->override_option('use_ajax', TRUE);
+  $handler->override_option('use_pager', '1');
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option('style_options', array(
+    'grouping' => '',
+    'override' => 1,
+    'sticky' => 1,
+    'order' => 'desc',
+    'columns' => array(
+      'delete_node' => 'edit_node',
+      'edit_node' => 'edit_node',
+      'timestamp' => 'title',
+      'created' => 'created',
+      'title' => 'title',
+      'name' => 'name',
+    ),
+    'info' => array(
+      'delete_node' => array(
+        'separator' => '',
+      ),
+      'edit_node' => array(
+        'separator' => ' | ',
+      ),
+      'timestamp' => array(
+        'separator' => '',
+      ),
+      'created' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'title' => array(
+        'sortable' => 1,
+        'separator' => ' ',
+      ),
+      'name' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+    ),
+    'default' => 'created',
+  ));
+  
+  $views[$view->name] = $view;
+
+
+
+
+
+  return $views;
+}
Index: contrib/apachesolr_views/apachesolr_views.module
===================================================================
RCS file: contrib/apachesolr_views/apachesolr_views.module
diff -N contrib/apachesolr_views/apachesolr_views.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contrib/apachesolr_views/apachesolr_views.module	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,10 @@
+<?php
+
+// $Id: apachesolr_views.module,v 1.1 2008/08/28 11:05:48 drunkenmonkey Exp $
+
+/**
+ * Implementation of hook_views_api().
+ */
+function apachesolr_views_views_api() {
+  return array('api' => '2.0');
+}
