Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2008 at 18:42 UTC
Updated:
10 Dec 2008 at 01:01 UTC
With dev cvs checkout, re-indexed site, and results were returned on the http://localhost:8983 but not on drupal's /search/apachesolr_search
noticed that the object Solr_Base_Query->_field_operator = 'AND'
the Solr_Base_Query constructor now defaults 'AND' to _field_operator
- function __construct($query) {
+ function __construct($querystring, $field_operator = "AND") {
so added '' to the function call so that 'AND' not restricting the search results.
| Comment | File | Size | Author |
|---|---|---|---|
| apachesolr_field_operator.patch | 713 bytes | aufumy |
Comments
Comment #1
aufumy commentedComment #2
robertdouglass commentedInteresting. I don't quite understand how this problem is occurring because "AND" is simply ignored to begin with, as can be seen in this function (Solr_Base_Query.php):
@aufumy - the approach of your patch isn't really correct. You shouldn't need the second parameter - letting it default to "AND" should not be a problem. Can you try to track down how exactly it is failing? Thanks!
Comment #3
aufumy commentedWithout the second parameter, on search
* rebuild_query() is called 4 times
** _query => test, 'test hash:09defabc5a9d20490be2c56c9484ac0c', 'test hash:09defabc5a9d20490be2c56c9484ac0c', test
With passing '' as the second parameter, on search
* rebuild_query() is called 12 times
** _query => test, 'test OR hash:09defabc5a9d20490be2c56c9484ac0c', 'test OR hash:09defabc5a9d20490be2c56c9484ac0c', test, 'test OR uid:1', test, test, 'test OR type:discussion', test, 'test OR type:group', test, 'test OR type:story'
Comment #4
aufumy commentedMy mistake, it appears that there is an issue with the passing of the hash, the patch above is not needed.
On the dev server there are multiple solr instances.
Comment #5
aufumy commentedI have deleted index, and run update many times over, to try to understand why it does not work on the dev site, but works on my local.
The hash passed upon update_index is the same that is passed when searching, but on the dev site, passing the hash upon search returns no search results.
Commented out these lines for apachesolr_search.module
Comment #6
robertdouglass commentedSo what is an appropriate title for this issue at the moment? As I understand it you're having problems moving a site between a local development environment and a remote development site? This would make sense because we're using the URL of the current site to generate the hash. I'd expect that reindexing after the move would fix the problem.
Please rename the issue and describe in more detail what your workflow is. Thanks!
Comment #7
aufumy commentedHi Robert
I am pretty stumped by the behavior, but I wanted to document.
My local environment is actually newer than the dev. The dev has not been copied from local.
On my local environment I am using jetty and on the dev it is tomcat I believe.
On the dev environment, I have attempted to debug by
* echoing the hash for search results in function apachesolr_search_search
* deleting the index, echoing the hash in function update_index that is shown when cron is run
* comparing the hash it appears identical
* however when running search no results are shown, unless hash not added as field in search (apachesolr_search_search)
Thanks
Audrey
Comment #8
aufumy commentedComment #9
aufumy commentedThe latest cvs checkout of apachesolr works fine as is on the dev box (wrt to hash).