Closed (duplicate)
Project:
Apache Solr Panels
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Nov 2010 at 12:56 UTC
Updated:
12 Sep 2012 at 00:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
steven jones commentedIf this gets committed, it would be good to get an honorable mention of the company that sponsored this work on the project page:
FreshNetworks - http://www.freshnetworks.com/
This is not a requirement on committing the patch, however.
Comment #2
ximo commentedThis would be a nice feature, but I'm not sure I would want to alter the $GLOBALS array like that.
You can actually achieve the same thing by implementing hook_apachesolr_modify_query():
I tried implementing that in Solr Panels (see second attachment), and while it did change the number of rows, the pager wouldn't keep up. Turned out to be a bug in the Apache Solr module, which was easy to fix (see first attachment). I'll leave it at that for now, but feel free to take it to the Apache Solr module's issue queue if you want to pursue it further.
Comment #3
kmadel commentedI was actually interested in adding more params than just the rows parameter, plus I wanted to have better integration with Apache Solr Autocomplete. I wanted to avoid my own custom hook_apachesolr_modify_query() as I wanted to have the UI based configuration that can be made available in Panels. Specifically, in addition to the rows parameter, I wanted to override the QF (query fields) parameter on a panel page by panel page basis (and more importantly, pass those parameters to Solr Autocomplete, but that is another issue). No doubt this is somewhat advanced configuration, but not much more advanced than specifying the Filter.
So, I may have a filter set up as 'type:bio tid:21', but then I would also like to specify the query fields for weight purposes but also to be utilized by Autocomplete, so I would like to add 'sort_ss_field_sir_name^10 ss_field_sir_name^10 sort_ss_field_given_name^5 ss_field_given_name^5 ss_sir_name_letter^5' as it is a list of persons that is being searched, and I only want to search against names. I would love to be able to do this all in one place. So, rather than having an apachesolr_panels_apachesolr_modify_query, and pulling stuff out of $_apachesolr_panels_conf, why not just forego calling apachesolr_search_execute() (which does not allow passing in additional parameters like rows or qf -- by the way, the Apache Solr Autocomplete goes even lower level and calls $solr->search to execute their autocomplete search), and basically create your own version of that function that then calls apachesolr_do_query() - thus giving you complete control over $params. Here is an example of what it could look like (and I would be happy to submit a patch if you are interested):
Comment #4
David_Rothstein commentedHere's a patch for Drupal 7.
Comment #5
ianthomas_ukPatch in #4 looks good to me. I note that it's almost identical to a patch submitted to a duplicate issue, http://drupal.org/node/1570598 and is pretty core functionality.
It would be great if we could get this committed, as the patch conflicts with the only other Apache Solr Panels issue that I need fixed, http://drupal.org/node/1708290 . I'm happy to create a new patch for that one to resolve the conflict.
Comment #6
acbramley commentedHi, sorry I have been so absent from the issue queue, I will test this today and hopefully get it committed :)
Comment #7
acbramley commentedClosing as duplicate of http://drupal.org/node/1708290 as the patch from there has been committed