Pay attention to the response writer
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | mlt.patch | 7.51 KB | robertdouglass |
| #20 | apachesolr.diff | 3.54 KB | mikejoconnor |
| #18 | apachesolr.diff | 331.83 KB | mikejoconnor |
| #17 | apachesolr_5.x_SolrPhpClient.diff | 328.84 KB | mikejoconnor |
| #14 | test failure 2.jpg | 429.55 KB | janusman |
Comments
Comment #1
JacobSingh commentedComment #2
JacobSingh commentedAttached is the big patch (against 6.x) for upgrading the client. There are few changes to the actual module (just some variable names), but the class is quite different. This also uses the JSON response handler (unlike the previous version where we used the XML response handler).
In addition, there is also a new simpletest! (DrupalSolrMatchTestCase) DO NOT RUN IT ON A PRODUCTION SITE BECAUSE IT WIPES THE INDEX!
I highly recommend that everyone try the test out and confirm it works. It is modeled (ripped) from Steven Whitten's test for search.module in D7.
Here is how the test works:
1. Make sure there are no entries in the index
2. Insert a few documents (7) with a keywords where we are expecting a certain number of results
3. fire off the tests and ensure we get the same results
on tear down:
delete the index.
There is still work needed on the test to get it to use proper lucene syntax. At the moment, it is just doing basic keyword searching as per drupal syntax and therefore works most of the time, but I haven't really confirmed it.
Still, I think it is worth committing as long as others find it useful and we can add more robust queries to test / facet selection tests later on.
Comment #3
janusman commentedUhm, just trying to understand this a bit more...
Are the attached patches against the SolrPhpClient directory *just* to sync it with the ZIP package (2008-09-02) here:
https://issues.apache.org/jira/browse/SOLR-341
...Or are there other changes that are bit in the package from the above URL?
Oh, also, there are some slight problems with the patch, like a patch for access control "sneaking in", extra whitespaces at the ends of lines, and tabs instead of whitespaces...
BTW this new SolrPhpClient needs PHP >=5.2.0 or the PECL JSON extension.
Are we then setting minimum requirements to be PHP >= 5.2.0?
Comment #4
JacobSingh commented@janusman
Thanks for the comments.
1. The access control thing... That's weird because I thought I had already committed *that* particular change. I'll have to look it up in the morning, sorry about that. I'll re-roll it what I have some more sleep.
2. I'm using a new IDE, so I apologize if it's got tabs set, I'll look into that as well.
3. The patch is just to sync the SolrPHPClient with the latest version AND provide compatibility in the module (because some structures have changed). I don't know what to do about the requirements. The PhpSolrClient uses JSON by default. The old version was hacked by Robert to use XML... I prefer to not hack the library if we can at all help it... but then we don't want to create a barrier to entry. What do you guys think?
More than the class, please try out the test, and see if that is working for you.
Best,
Jacob
Comment #5
robertdouglass commentedIn chat I encouraged Jacob to package his test with the patch. If we decide not to update to the latest Solr PHP client because of the 5.2 dependency (which I hadn't considered), we at least need to extract the test.
What is our current minimum PHP version requirement for this module? Does anyone know? How early of a PHP will break the code we currently ship?
Comment #6
robertdouglass commentedLooked briefly at the tests. What I learned:
We are writing tests for the DRUPAL-6--1-2 version of the simpletest module, not the DRUPAL-6--2-x branch.
I removed the use of dpr() (since it comes from devel module), fixed a couple whitespace errors, and zipped up the file. It makes evaluating the tests easier. Maybe we need a different issue for this?
Comment #7
robertdouglass commentedComment #8
JacobSingh commentedWell, the test is dependent on the new library code.
Have either of you applied it and ran the test?
Comment #9
janusman commentedNot yet tested, have to install a D6 instance or wait for the D5 patch.
My only point was about raising the minimum supported version of PHP. IMO I say we use the new SolrPhpClient as long as we don't also need to use Solr1.3 (not yet stable), and set the minimum PHP requirements to 5.2.0
From the WTF department-- my locally-compiled PHP 5.1.6 has json_encode/decode support... and I don't seem to have compiled that in :)
Comment #10
robertdouglass commented@janusman: tsk tsk... please do the necessary to be able to review D6 patches!
Comment #11
JacobSingh commentedI don't know where to go forward here, but I think we should get this committed really soon because other patches are subject to get screwed up if we are changing our primary interface. Plus, all of our commits should be run against a simpletest...
What do you guys think? Should I commit this, or is more work needed from Robert's patch?
Comment #12
janusman commentedProblems...
I tried to apply this to the DRUPAL-6 version (patch -p0 < new_solr_php_library_and_index_test.diff inside the apachesolr/ dir) and I got these errors:
The rest seems to have patched correctly. After manually patching the rest of Service.php, the interface seems to work fine (only found the link to "run cron" is bad after deleting the index, but that's not the patch's fault).
With the simpletest-6.x-1.2 module installed, these problems come up (starting from a clean Solr index):
After replacing a test with robert's from #6, the same failures and exceptions come up.
Comment #13
janusman commentedWoops! It seems I already had some nodes in my install (tsk, you only mentioned the INDEX would get clobbered!)
Will test again from zero nodes.
Comment #14
janusman commentedHm. Weird. I reinstalled a D6 instance, have no content in it, restarted Solr, installed the apachesolr, simpletest and other modules, and I am now getting different problems:
1) Can't run the Solr/search results test; the page never actually finished loading (and Solr is not doing anything).
2) Other tests run, but Solr/query breadcrumb and Solr/query handling return failures.
See attached image.
Comment #15
JacobSingh commentedYeah, looks like the patch has gone stale. I'll try to re-roll it tonight.
Regarding the tests, I don't really know about the other tests, this one is just for the index/query test. It seems to be working okay, although you are getting different results for some of those... are you using a different version of solr?
Best,
J
Comment #16
janusman commentedIm running Solr 1.2.0... copied the schema.xml from the yesterday's DRUPAL-6--1 branch...
Comment #17
mikejoconnor commentedHere is a patch against the 5.x version.
This patch will update the SolrPhpClient that ships with apachesolr-5.x-1.x-dev, to the SolrPhpClient.2008-09-02.zip found here https://issues.apache.org/jira/browse/SOLR-341
I have tested this against my 5.x install of the apacheSolr Module using Solr 1.3.0
Note: this patch does not include tests, it only updates the SolrPhpClient.
Comment #18
mikejoconnor commentedThe previous patch missed the apachesolr.module and apachesolr_search.module files.
Comment #19
robertdouglass commentedHmm. I run into this problem while applying the patch:
Comment #20
mikejoconnor commentedHere is a patch for just the apachesolr.module and apachesolr_search.module from 5.x-1.x
Hope that helps.
Comment #21
robertdouglass commentedThat patch was incomplete. Use this one to upgrade to D6.
Comment #22
mikejoconnor commentedAssigning to myself
Comment #23
robertdouglass commentedDone for both branches. Please open another issue with the simple tests - we need those to not get lost or forgotten.
Comment #24
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.