YiiSolr
YiiSolr copied to clipboard
Compatibility with Solr 4
Just tried to set up YiiSolr with Solr 4.4, several errors pop up when running the tests, especially this one:
Unknown commit parameter 'waitFlush'
Upon searching the error on google, it sounds like this is a Solr 3 command that was removed on Solr4.
@hallucynogenyc - Errors? or just warnings?
The YiiSolr Yii extension worked for us after we upgraded from Solr3 to Solr4. The only problem we had was that we started getting warnings about 'allowDups':
Jun 4, 2013 6:26:36 AM org.apache.solr.handler.loader.XMLLoader processUpdate WARNING: Unknown attribute id in add:allowDups
It was a issue with the Pecl solr library (v 1.0.2)
$sudo pecl info solr-stable | grep "Release Version" Release Version 1.0.2 (stable)
To fix the warning, we used a modified solr libary downloaded from https://github.com/ecaron/php-pecl-solr which includes the tiny fix that removes the deprecated method.
No, errors. This is the output of phpunit on a clean solr 4.4 installation:
Tests: 27, Assertions: 301, Failures: 6, Errors: 11.
I see. To be honest, I didn't run the tests. But I can confirm that the extension works for Solr 4.2 - we use it very intensively and find it invaluable.
Well, it might work properly if you don't use the part that is broken (apparently the broken part is trying to commit, so if your app is read only that might be why it's not breaking), but that still doesn't change the fact that it's broken!
aha. In our app, we don't commit explicitly, instead we make use of commitwithin
. This is from my notes:
The YiiSolr Yii extension uses a Solr feature called "commitWithin" which is similar to "autoCommit" but better:
CommitWithin is a commit strategy introduced in Solr 1.4, which lets the client ask Solr to make sure the document gets committed within a certain time. This leaves the control of when to do the commit to Solr itself, optimizing number of commits to a minimum while still fulfilling the update latency requirements. If I say
<add commitWithin=10000>
(in an XMLUpdateRequestHandler update), that tells Solr to make sure the document gets committed within 10000ms, i.e. 10s. I can then continue to add other documents within those 10 seconds (possibly with other commitWithin values), and Solr will automatically do a<commit>
when the oldest document in the buffer is due.