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 |
Jump to:
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
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
But not in in 6-x-1-dev, should be fairly simple to backport that, no ?
#3
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
Automatically closed -- issue fixed for 2 weeks with no activity.