Jonathon 255 Posted August 29, 2013 Report Share Posted August 29, 2013 Hi Larry, Just wondered if you planned on using Zend Lucene for this like some older articles you wrote? Second question. If so, are your current articles on it still accurate with changes to Yii or Zend since you wrote them? Thanks Jonathon Quote Link to post Share on other sites
Larry 428 Posted August 29, 2013 Report Share Posted August 29, 2013 Hey Jonathon, Thanks for the questions. Originally I was planning on using Zend Lucene in that chapter, and I haven't changed my mind, but I also haven't revisited the topic yet. As far as I know, those articles I wrote on using the two together are correct. Please let me know if you see anything not work. Quote Link to post Share on other sites
Jonathon 255 Posted August 29, 2013 Author Report Share Posted August 29, 2013 I shall try and get through it soon and let you know how I get on in general and any points of confusion or further clarity in case they will be of use to you in the book. Quote Link to post Share on other sites
Jonathon 255 Posted August 30, 2013 Author Report Share Posted August 30, 2013 First issue, zend doesn't seem to have the same set up now. No exception or lucene search. So I downloaded https://github.com/zendframework/ZendSearch that seemed to encompass these files and i placed them in the vendors/zend/ directory. So my structure is: vendors - zend - ZendSearch - lucene - exception Looks like Zend_Search_Lucene has now become just Lucene. Additionally I think you need to use namespaces to load it properly. I have tried: // import zend files 04 Yii::setPathOfAlias('ZendSearch',Yii::getPathOfAlias('application.vendors.Zend.ZendSearch')); 05 06 // include Lucene.php 07 require_once('Lucene/Lucene.php'); That fails for me.failed to open stream: No such file or directory But the Lucene folder is below the ZendSearch folder and Lucene.php resides within there. I made changes based on this link http://www.yiiframework.com/doc/guide/1.1/en/extension.integration Quote Link to post Share on other sites
Jonathon 255 Posted August 30, 2013 Author Report Share Posted August 30, 2013 Ok, I made some progress // import zend files Yii::setPathOfAlias('ZendSearch',Yii::getPathOfAlias('application.vendors.Zend')); // include Lucene.php require_once( Yii::getPathOfAlias('ZendSearch'). '/ZendSearch/Lucene/Lucene.php'); But within the action section I think you need to access Lucene like: $index = new ZendSearch\Lucene; That says that the include paths fails. Which is right because it references it as 'vendors/Zend/Lucene' from the setPathOfAlias I imagine. When it needs to be 'vendors/Zend/ZendSearch/Lucene./Lucene.php. So I know the problem I believe but I'm unsure how to go correctly about it rather than just make a hash of it. Because I thought the require_once would avoid this problem as Lucene.php has been included. On a side note. I hear good thinks about Solr. Quote Link to post Share on other sites
Larry 428 Posted August 31, 2013 Report Share Posted August 31, 2013 Thanks for sharing your experience. I totally forgot that ZF has changed significantly since I wrote those articles. I'll have to revisit this carefully when the time comes. Quote Link to post Share on other sites
Jonathon 255 Posted August 31, 2013 Author Report Share Posted August 31, 2013 There seems to be very little around for the new ZendSearch (ZF2). I'm not expecting any answers on here I just thought i'd let you know how I was getting on, which wasn't amazing. I am considering using a SOLR extension as reading around SOLR seems to be very quick where as Lucene has a tendancy to become slow (how accurate that is i do not know), but a couple of the SOLR extensions look outdated. Also came across ElasticSearch which seemed interesting, I see S/O are using it too. There's a Yii extension for it also https://github.com/tripiko/yii-elasticsearch (Seems up to date, but no docs yet for it) Anyway, thank Larry Jonathon Quote Link to post Share on other sites
Antonio Conte 426 Posted August 31, 2013 Report Share Posted August 31, 2013 You should really be using composer rather than downloading manually. It probably has lots of dependences, and it would be a pain in the butt to keep it all up-to-date. The composer.json here: https://github.com/zendframework/ZendSearch/blob/master/composer.json Quote Link to post Share on other sites
Jonathon 255 Posted August 31, 2013 Author Report Share Posted August 31, 2013 Thanks Antonio Quote Link to post Share on other sites
Larry 428 Posted September 5, 2013 Report Share Posted September 5, 2013 Ironically (or not), both SOLR and ElasticSearch are based upon Lucene. I'll have to do some research and make a good decision for that example chapter. Thanks for bringing it up, Jonathon! Quote Link to post Share on other sites
Jonathon 255 Posted September 5, 2013 Author Report Share Posted September 5, 2013 Yes i'd read they were based on Lucene. Nice to have some options either way! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.