Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2009 at 13:32 UTC
Updated:
21 Apr 2011 at 03:48 UTC
in apachesolr_search_execute, there is a $params array. This should really all be encapsulated inside of the query object.
This code is silly:
// This hook allows modules to modify the query and params objects.
apachesolr_modify_query($query, $params, $caller);
You can do many things to the query at this point that won't affect the outcome because the only method of $query that gets called in the searching is $query->get_query_basic():
$response = $solr->search($query->get_query_basic(), $params['start'], $params['rows'], $params);
The API signature should be something more along the lines of $solr->search($query);
Functions like apachesolr_search_basic_params($query) are also misplaced and should be part of a base class. The state that gets set with apachesolr_search_basic_params should just be part of the constructor, or should be passed into the constructor.
Comments
Comment #1
Scott Reynolds commentedDavid and I were just debating the same here
#544570: Provide a way to alter the boost, facet and basic parameters
Comment #2
jpmckinney commentedComment #3
pwolanin commentedThis should happen in the Drupal 7 port, not Drupal 6 at all.
Comment #4
jpmckinney commentedComment #5
jpmckinney commentedMarking #560596: Filter Queries supported? duplicate. See comment #5: #560596-5: Filter Queries supported?.
Comment #6
Scott Reynolds commentedFor the curious, why?
Comment #7
pwolanin commented@Scott - the 6.x-2.x branch is far enough to be in production for many people. At DCSF we heard feedback that people would be very put out by API changes there.
@all - I just labeled the HEAD release as 7.x-1.x - James beat me to changing the label here once I made it possible.
Comment #8
pwolanin commentedalready done for for 7.x.
I'm considering whether it would make sense to make 6.x-2.x a backport of 7.x-1.x in more places. This would totally break APIs, schema, etc.
However, given the lack of contributions to keeping 6.x-2.x going, I would no longer feel much remorse.
Comment #9
robertdouglass commentedI think that it is better to have a healthy 6.2 that is forwards compatible than to protect the implementation that currently exist. We have to document the changes well for those who will do the upgrades (6.2 -> 6.2.x) but, yes, the goal should be keeping in step with 7.0.
Comment #10
pwolanin commentedWe will make a 6.x-3.x to be in sync with 7.x-1.x (confusing as though that might be)
Comment #11
pwolanin commentedwe'll do this in 6.x-3.x