You are here

interface Drupal_Solr_Query_Interface in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 5.2 apachesolr.module \Drupal_Solr_Query_Interface
  2. 6 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 2386
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. Defaults to NULL.
   */
  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) If TRUE, the filter will be negative,
   *   meaning that matching values will be excluded from the
   *   result set. Defaults to FALSE.
   */
  function add_filter($field, $value, $exclude = FALSE);

  /**
   * Remove a filter from the query.
   *
   * @param string $field
   *   The facet field to remove
   * @param string $value
   *   (optional) The facet value to remove. Defaults to 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
   *   (optional) The operator to use within the filter part of the subquery.
   *   Defaults to 'OR'
   * @param string $q_operator
   *   (optional) 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. Defaults to 'AND'
   */
  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