Setter for changing the query's keys.

zuuperman - October 29, 2009 - 11:36
Project:Apache Solr Search Integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

It would be great if other modules could change the search keys in the current search query.

For example, in one of our sites. We need to search on a given field, when a searchmode is given.

We do the following in the apachesolr_modify_query hook:
if (isset($_GET['searchmode'])) {
$params['qt'] = 'standard';
$query->setKeys($_GET['searchmode'] .':'. search_get_keys());
}

Following was added in Solr_Base_Query.php
/**
* Set the search keywords
*/
public function setKeys($keys) {
$this->keys = $keys;
}

#1

janusman - November 2, 2009 - 15:43
Status:active» closed

Uhm, Solr_Base_Query.php in 6.x-2.x-dev already had this:

/**
   * Set keywords in this query.
   *
   * @param $keys
   *   New keywords
   */
  function set_keys($keys) {
    $this->keys = $keys;
  }

  /**
   * Get this query's keywords.
   */
  function get_keys() {
    return $this->keys;
  }

=) Closing this out.

#2

swentel - November 3, 2009 - 17:02
Status:closed» active

But not in in 6-x-1-dev, should be fairly simple to backport that, no ?

#3

robertDouglass - November 4, 2009 - 11:22
Version:6.x-2.x-dev» 6.x-1.x-dev
Status:active» fixed

Hi swentel,

there's a patch in the closed issue somewhere that you can use to backport your DRUPAL-6--1 version. I'll leave the issue open for pwolanin to look at and decide if he wants it in DRUPAL-6--1. I'm inclined not to backport.

Please find that issue and reopen it, marking it "patch (to be ported)". Thanks.

#4

System Message - November 18, 2009 - 11:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.