You are here

interface Drupal_Solr_Query_Interface in Apache Solr Search 6

Same name and namespace in other branches
  1. 5.2 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 1883
Integration with the Apache Solr search application.

View source
interface Drupal_Solr_Query_Interface {

  /**
   * Get all filters, or the subset of filters for one field.
   *
   * @param $name
   *   Optional name of a Solr field.
   */
  function get_filters($name = NULL);

  /**
   * 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);

  /**
   * 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);

  /**
   * 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);

  /**
   * Get the query's keywords.
   */
  function get_keys();

  /**
   * Set the query's keywords.
   *
   * @param string $keys
   *   The new keywords.
   */
  function set_keys($keys);

  /**
   * Removes the query's keywords.
   */
  function remove_keys();

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

  /**
   * Return filters and sort in a form suitable for a query param to url().
   */
  function get_url_queryvalues();

  /**
   * Return the basic string query.
   */
  function get_query_basic();

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

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

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

  /**
   * 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);

  /**
   * 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');

  /**
   * 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();

}

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 Get all filters, or the subset of filters for one field. 1
Drupal_Solr_Query_Interface::get_keys function Get the query's keywords. 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 filters and sort in a form suitable for a query param to url(). 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_keys function Removes the query's keywords. 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_keys function Set the query's keywords. 1
Drupal_Solr_Query_Interface::set_solrsort function Set the solrsort. 1