You are here

interface Drupal_Solr_Query_Interface in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 6 apachesolr.module \Drupal_Solr_Query_Interface
  2. 6.2 apachesolr.module \Drupal_Solr_Query_Interface

The interface for all 'query' objects.

Hierarchy

Expanded class hierarchy of Drupal_Solr_Query_Interface

All classes that implement Drupal_Solr_Query_Interface

File

./apachesolr.module, line 1763
Integration with the Apache Solr search application.

View source
interface Drupal_Solr_Query_Interface {

  /**
   * Checks to see if a specific filter is already present.
   *
   * @param string $field
   * the facet field to check
   *
   * @param string $value
   * The facet value to check against
   */
  function has_filter($field, $value);

  /**
   * Remove a filter from the query
   *
   * @param string $field
   * the facet field to remove
   *
   * @param string $value
   * The facet value to remove
   * This value can be NULL
   */
  function remove_filter($field, $value = NULL);

  /**
   * Add a filter to a query
   *
   * @param string $field
   *   the facet field to apply to this query
   *
   * @param string value
   *   the value of the facet to apply
   *
   * @param boolean $exclude
   *   Optional paramter.  If TRUE, the filter will be negative,
   *   meaning that matching values will be excluded from the
   *   result set.
   */
  function add_filter($field, $value, $exclude = FALSE);

  /**
   * Return the search path (including the search keywords).
   */
  function get_path();

  /**
   * Return an array of parameters for use in the l function.
   *
   * @see l()
   */
  function get_url_queryvalues();

  /**
   * return the basic string query
   */
  function get_query_basic();

  /**
   * Set the solrsort.
   *
   * @param $field
   *  The name of a field in the solr index that's an allowed sort.
   *
   * @param $direction
   *  'asc' or 'desc'
   */
  function set_solrsort($field, $direction);

  /**
   * Get the solrsort.
   *
   * Returns the non-urlencode, non-aliased sort field and direction.
   * as an array keyed with '#name' and '#direction'.
   */
  function get_solrsort();

  /**
   * Return an array of all filters.
   */
  function get_filters($name = NULL);

  /**
   * Add a subquery to the query.
   *
   * @param Drupal_Solr_Query_Interface $query
   *   The query to add to the orginal query - may have keywords or filters.
   *
   * @param string $fq_operator
   *   The operator to use within the filter part of the subquery
   *
   * @param string $q_operator
   *   The operator to use in joining the subquery to
   *   the main keywords.  Note - this is unlikely to work
   *   with the Dismax handler when the main query is only
   *   keywords.
   */
  function add_subquery(Drupal_Solr_Query_Interface $query, $fq_operator = 'OR', $q_operator = 'AND');

  /**
   * return the sorts that are provided by the query object
   *
   * @return array all the sorts provided
   */
  function get_available_sorts();

  /**
   * Remove a specific subquery
   *
   * @param Drupal_Solr_Query_Interface $query
   * the query to remove
   */
  function remove_subquery(Drupal_Solr_Query_Interface $query);

  /**
   * remove all subqueries
   */
  function remove_subqueries();

  /**
   * make a sort available
   */
  function set_available_sort($field, $sort);

}

Members

Namesort descending Modifiers Type Description Overrides
Drupal_Solr_Query_Interface::add_filter function Add a filter to a query 1
Drupal_Solr_Query_Interface::add_subquery function Add a subquery to the query. 1
Drupal_Solr_Query_Interface::get_available_sorts function return the sorts that are provided by the query object 1
Drupal_Solr_Query_Interface::get_filters function Return an array of all filters. 1
Drupal_Solr_Query_Interface::get_path function Return the search path (including the search keywords). 1
Drupal_Solr_Query_Interface::get_query_basic function return the basic string query 1
Drupal_Solr_Query_Interface::get_solrsort function Get the solrsort. 1
Drupal_Solr_Query_Interface::get_url_queryvalues function Return an array of parameters for use in the l function. 1
Drupal_Solr_Query_Interface::has_filter function Checks to see if a specific filter is already present. 1
Drupal_Solr_Query_Interface::remove_filter function Remove a filter from the query 1
Drupal_Solr_Query_Interface::remove_subqueries function remove all subqueries 1
Drupal_Solr_Query_Interface::remove_subquery function Remove a specific subquery 1
Drupal_Solr_Query_Interface::set_available_sort function make a sort available 1
Drupal_Solr_Query_Interface::set_solrsort function Set the solrsort. 1