Oh I am lazy for not posting my second cup of lithium over here . But you can check something over http://dev.lithify.me/forks/harikt/lithium_blog/wiki/home . So you know I am a fan boy of Lithium. I used to hang on #li3 irc just for fun, though I am not developing anything serious with lithium for now .
We used to read the documentation with the help of li3_docs plugin. Its so cool. But searching locally was not possible. If you have internet connection then it may not be a trouble too :) . Questions come and go, sometimes we may be knowing where we read it, but don't remember the exact controller action or the property. Oh my :-)
So I finally decided to hack on li3_docs plugin to make a search locally with the help of the Zend_Search_Lucene 's power . You can read more about Zend Lucene component over here. This is also a good point to show you that anything can be integrated with li3 ;). So no more blha blha blha . Just codes coming on the way .
First you need to create the index pointing to /searches/makeindex . Before doing that change the url according to yours. For now I assume http://lithium.local/docs/ which is the only part I have hard coded. Nate has agreed to look into it and make the necessary changes and we will try to make it as plugin if he loves :-). So the files are below. I hope know something about li3, li3_docs etc. This uses the extractor from li3_docs :-)
You can see how I have included the Zend library as from http://dev.lithify.me/lithium/wiki/guides/using/zend
Do create an empty file makeindex.html.php in the searches folder of view before creating index.
Now do your way, may be add a form and point to the controller and action or what ever you love. As always licensed under the same licene of http://lithify.me/ . Hang on to #li3 on irc.freenode.net to ask anything more on it :-) .
Note : Set time limit to 0 . ie set_time_limit( 0 ); in bootstrap.php for creating the index. The methods are called recursively and needs sometime to create the index . Once indexed you don't want , just query through it .


Comments
Rad. Haven't had the chance
Rad. Haven't had the chance to give it a go but great idea and the code looks good.
Thanks Jon for your comments
Thanks Jon for your comments :-) .
Try when you get sometime and let me know any suggestions or anything else :-)
it has been surely very
it has been surely very knowledgeable article cum tutorial elegantly described and illustrated as well
Add new comment